label_colour 密钥存储在 apache-superset 中的什么位置?

Where are label_colour keys stored in apache-superset?

版本: Docker 来自 here

的实例

根据 docs 我可以根据标签编辑颜色;

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.

通过调整JSON发现如下;

我的 JSON 代码在哪里;

{
"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": "{}"
}

提供赏金后不久,我找到了缺失的那块拼图..

代码需要稍微修改,因为键需要小写,这样就变成了;

{
"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": "{}"}