-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Are there any ways to set the color for the chart specifically #2524
Comments
@ijyun - not at the moment. Could be an interesting feature to implement. I know several people have enquired about it. |
It's somewhat challenging. Currently we guarantee that metrics of the same name in a dashboard will be the same color across charts. There's this function/object that cycles through the palette and provide a new color for new expressions and memoizes as it goes. If you ask for Early on I would hash "Metric 1" and provide a color based on the hash so that "Metric 1" would ALWAYS be the same color. The problem there was that with say 8 colors, you relatively often get in situation where a chart with say 2 or 3 metrics will get the same color twice, and that's no good. A chart with "Metric 1" and "Metric 2" might have the same color for both 1 out of 8 times... Someone in the community said they pre-populate that memoized object with an array of all their important metrics. For reference: Somehow f you call |
Hi mistercrunch Thanks |
It'd be nice to support different color schemes, and allow people to pick a default in their environment. It would also be nice to make "Colors" one of the core set of controls, cohesive across visualizations, but that's a bit more complicated. For now the categorical colors are defined here: A first step might be to define an object with different color sets, and add a new control to most visualizations that would allow to pick the color set. And add a new |
Hello guys! In my company different products use different colors but same superset, in my particular case I can not use unique color pallet. |
It's somewhat easy to add new palettes and set one as default but you'll have to do this in your fork. It could be nice to add an environment variable to define your default color scheme without having to alter the code and bake your own build. |
There's now a way to do this that should work in most cases: |
There's now a way to do this that should work in most cases: |
@mistercrunch I tried to enforce a colors in the link described way but wasn't really successful. Have you experience in defining colors in superset and maybe a more precise experience? |
@mistercrunch I've also tried that method as SO question without success. |
I got that to work but for me the chart must also be set to the default colour scheme |
Wait do you want to set colors a specific way or do you want the default color scheme? |
Specific colours for keys but these persist across an entire instance of superset. Per dashboard is fine but I will test as a scheme if that can be key specific? With the dashboard code it will only alter the chart if the chart is using the default colour scheme (for me) if you select a different colour scheme the override does not work. |
I'd be nice to add a global environment setting for this, I'm not sure why this only applies to the default color scheme, but that's not the intended behavior. |
I can confirm you have to have this set to the default color scheme to work. |
@mistercrunch How do I get to the "JSON Metadata" view from your top screenshot? |
@rangerscience viewing the dashboard, click "Edit Dashboard", then click the ▼ menu and select "edit dashboard metadata". |
HI @mistercrunch I have tried ur method but it is showing an error has occurred I have given exactly without any error can u give some more info regarding this |
How to change x,y axis label color? anyone know about this? many many thanks |
Updated link: https://superset.apache.org/docs/frequently-asked-questions#is-there-a-way-to-force-the-use-specific-colors |
This is still broken in 1.2.0.
works, while
does not, e.g. JSON metadata order matters (which does not make any sense). |
Hi team,
Right now,When I refresh the dashboard the color of the chart would change automatically.I want to set the color for the chart and dont' change after refresh.
Could you please tell me are there any ways?
Thanks
The text was updated successfully, but these errors were encountered: