Customise color schema for each chart on dashboard #25623
-
Hi all, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You can use the label_colors property in the dashboard JSON metadata. To access the dashboard JSON metadata, go to Edit dashboard and then click on the three dots in the top right corner and select Edit properties. Expand the ADVANCED section and you will see the JSON METADATA field. In the JSON METADATA field, add a new section called label_colors. In this section, you can specify the desired colors for each metric/dimension. like:
This will set the color for metric_1 to be red and green, and the color for metric_2 to be blue and yellow. You can also use the label_colors property to specify different color schemes for different charts. you can add a new section to the label_colors property for each chart.
This will set the color for metric_1 in chart_1 to be red and green, and the color for metric_2 in chart_1 to be blue and yellow. The colors for metric_1 and metric_2 in chart_2 will be reversed. Once you have added the label_colors property to the dashboard JSON metadata, save the dashboard. Superset will then use the specified colors for the labels in each chart. If you are using a custom color scheme, you need to make sure that the color scheme is defined in the superset_config.py file, to add a new color scheme called my_color_scheme, you would add the following line to the superset_config.py file:
Once you have added the color scheme to the superset_config.py file, you can use it in the dashboard JSON metadata. To use the my_color_scheme color scheme for the chart_1 chart, you would add the following section to the dashboard JSON metadata:
Let me know if this works. |
Beta Was this translation helpful? Give feedback.
-
I'm having trouble trying to set the label_colors to a Mixed chart, it only works on Query A, while Query B is ignored. |
Beta Was this translation helpful? Give feedback.
You can use the label_colors property in the dashboard JSON metadata.
To access the dashboard JSON metadata, go to Edit dashboard and then click on the three dots in the top right corner and select Edit properties. Expand the ADVANCED section and you will see the JSON METADATA field.
In the JSON METADATA field, add a new section called label_colors. In this section, you can specify the desired colors for each metric/dimension.
like:
This will set the color for metric_1 to be red and green, and the color for metric_2 to be blue and yellow.
You can also use the label_colors property t…