Incubator-superset: charts colors forced in dashboard do not work anymore ("label_colors")

Created on 26 Nov 2020  路  8Comments  路  Source: apache/incubator-superset

See #2524

In a dashbord properties, one can set "label_colors", so that all charts on the dashboard will share the same colors for identical data.

It's been broken in 0.37.2 and 0.38.0.

Last time seen working was 0.36.0

Expected results

all charts share the predefined colors of each category, set using "label_colors"

Actual results

charts original colors arekept, or the one chosen in dashboard is used, but label_colors is ignored

Screenshots

When it works :

image

With newer version :

image

How to reproduce the bug

  1. create two bar charts showing categories "category1, category2, ... for instance". Define a different custom palette for each
  2. add them on a dashboard
  3. go to edit / edit dashboard properties
  4. in dashboard properties set for instance
"label_colors": {
    "category1": "rgb(248, 166,28)",
    "category2": "black",
    "category3": "rgb(227, 59, 5)",
    "category4": "rgb(245, 104, 7) ",
    "category5": "rgb(230, 28, 96)",
    "category6": "rgb(0, 228, 201) "
  },
  1. look at the dashboard : it does never use these "label_colors"

NOTE : in dashboard settings, selecting a palette does overwrite charts palettes, removing a palette tehre leaves the charts one,
but "label_colors" is never used.

Environment

  • superset version: superset version
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Superset 0.38.0
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  • python version: python --version
- Python 3.6.7

node.js version: node -v

v12.16.3

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • [x] I have reproduced the issue with at least the latest released version of superset.
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

#bug .pinned

Most helpful comment

Finally I've one thing that works, I hope it will help tackle the root issue, which is in the end : one has to guess the right charts settings and nothing guides the tries and errors :) ... and it changed over time.

If you have

  • charts with "superset" color palette chosen (AND NO OTHER)
  • note : any custom 'label_colors' can be defined on the chart itself, not an issue
  • dashboard with any color palette chose or even null
  • then add {"label_colors":{"name":"#123456"}} to Dashboard json properties
  • don't forget to refresh Dashboard after each label_color change

=> in this case it works

Once upon a time : Charts required ti use rb&b palette, now it requires superset.

All 8 comments

try refresh the page and see if changes take place?
same and related issues #11677 #11674

I tried. So many refreshes and combinations of actions. Save, save as new, ne charts, remove colors entirely from dashborad properties, etc etc.

a word about #11674 : in that issue, the consistence in dashboard --> explore chart worflow is disccussed.

In my case I'm more looking for consistency on a single dashboard accross different charts. It's slightly different and the solution may be the same in the end. But as a "use case" it's very different, I hope the initial explanation was undertandable :)

The need underneath is : affect one fixed color to a category once and for all. (Once per dashboard or even one for all susperset, in my specific case it would be fine)

You simply need to set up a default color for your dashboard.

Already tried that, or maybe I might not understand really what you mean. Could you elaborate a bit ? I'd be more than happy to make it work.

I can ensure you that label_colors work in dashboards for superset 38.
I have trouble editing dashboard metadata with the menu so I usually go on dashboard list, click on the edit buttom and change the value of colors_scheme as shown on the picture.

Screenshot 2020-12-08 at 11 55 03

That's weird.
I can edit as you do from dashboard list, or even from dashboard edit itself (choosing a color scheme from dropdown).
It does persist "color_scheme" alright.
But then : these colors are applied to all charts in dashboard.
(It seems funny when I write it because : it's exactly what one would expect I guess when choosing a dashboard color scheme.)

my "label_colors" are ignored.

example of my json (masked names but you'll get the idea). I don't see label_colors in your case, could you expand a bit the view ? maybe I set them in a wrong place (that used to work though)

image

(additional info : there seems to be indeed some cases when it works, then something break it, still investigating to see from scratch at what moment soemthing goes wrong)

Finally I've one thing that works, I hope it will help tackle the root issue, which is in the end : one has to guess the right charts settings and nothing guides the tries and errors :) ... and it changed over time.

If you have

  • charts with "superset" color palette chosen (AND NO OTHER)
  • note : any custom 'label_colors' can be defined on the chart itself, not an issue
  • dashboard with any color palette chose or even null
  • then add {"label_colors":{"name":"#123456"}} to Dashboard json properties
  • don't forget to refresh Dashboard after each label_color change

=> in this case it works

Once upon a time : Charts required ti use rb&b palette, now it requires superset.

Was this page helpful?
0 / 5 - 0 ratings