Allow users to specify label->color mapping (#3879)

Users can define `label_colors` in a dashboard's JSON metadata that
enforces a label to color mapping.

This also makes the function that maps labels to colors case insensitive.
This commit is contained in:
Maxime Beauchemin
2017-11-17 15:56:04 -08:00
committed by GitHub
parent a84bd5225c
commit a82bb588f4
4 changed files with 64 additions and 4 deletions

View File

@@ -221,3 +221,19 @@ When adding columns to a table, you can have Superset detect and merge the
new columns in by using the "Refresh Metadata" action in the
``Source -> Tables`` page. Simply check the box next to the tables
you want the schema refreshed, and click ``Actions -> Refresh Metadata``.
Is there a way to force the use specific colors?
------------------------------------------------
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.
..code::
{
"label_colors": {
"Girls": "#FF69B4",
"Boys": "#ADD8E6"
}
}