apache-superset中的label_colour键存储在哪里? [英] Where are label_colour keys stored in apache-superset?

查看:184
本文介绍了apache-superset中的label_colour键存储在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

版本:来自此处的Docker实例

根据

提供赏金后不久,我发现了拼图的缺失部分.

需要对代码进行少量编辑,因为键必须使用小写字母,以便变得;

{
"filter_immune_slices": [],
"timed_refresh_immune_slices": [],
"filter_immune_slice_fields": {},
"expanded_slices": {},
"label_colors": {
"a": "#007F3D",
"b": "#2C9F29",
"c": "#9DCB3C",
"d": "#FFF200",
"e": "#F7AF1D",
"f": "#ED6823",
"g": "#E31D23"
},
"default_filters": "{}"
}

但是,如果您将图表颜色方案设置为超出默认选项的任何值,则仍不会显示预期的颜色方案.将cahrt配色方案设置回默认值,您应该得到想要的.我的构建的默认值为;

要对此进行测试,请转到示例仪表板births并编辑仪表板>编辑仪表板元数据,如下所示更改JSON元数据;

{"filter_immune_slices": [], "timed_refresh_immune_slices": [], 
"filter_immune_slice_fields": {}, "expanded_slices": {}, "label_colors": 
{"boy": "#9DCB3C","girl": "#F7AF1D"}, 
"default_filters": "{}"}

Version: Docker instance from here

According to the docs I can edit colours based on labels;

It is possible on a per-dashboard basis by providing a mapping of labels to colors in the JSON Metadata attribute using the label_colors key.

By adjusting the JSON found as below;

Where my code for JSON is;

{
"filter_immune_slices": [],
"timed_refresh_immune_slices": [],
"filter_immune_slice_fields": {},
"expanded_slices": {},
"label_colors": {
"A": "#007F3D",
"B": "#2C9F29",
"C": "#9DCB3C",
"D": "#FFF200",
"E": "#F7AF1D",
"F": "#ED6823",
"G": "#E31D23"
},
"default_filters": "{}"
}

解决方案

Shortly after offering a bounty I figured out the missing piece of the puzzle..

The code needed a slight edit as keys needed to be lower case so that became;

{
"filter_immune_slices": [],
"timed_refresh_immune_slices": [],
"filter_immune_slice_fields": {},
"expanded_slices": {},
"label_colors": {
"a": "#007F3D",
"b": "#2C9F29",
"c": "#9DCB3C",
"d": "#FFF200",
"e": "#F7AF1D",
"f": "#ED6823",
"g": "#E31D23"
},
"default_filters": "{}"
}

However this will still not show the intended colour scheme if you have set the chart colour scheme to anything over than the default option. Set the cahrt colour scheme back to the default and you should get what you want. Default on my build is;

To test this go to the example dashboard births and edit dashboard > edit dashboard metadata change the JSON Metadata as below;

{"filter_immune_slices": [], "timed_refresh_immune_slices": [], 
"filter_immune_slice_fields": {}, "expanded_slices": {}, "label_colors": 
{"boy": "#9DCB3C","girl": "#F7AF1D"}, 
"default_filters": "{}"}

这篇关于apache-superset中的label_colour键存储在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆