superset icon indicating copy to clipboard operation
superset copied to clipboard

Cannot set color scheme for dashboard-associated chart even when dashboard color scheme is cleared

Open jonhoo opened this issue 2 years ago • 11 comments

Once a chart is associated with a dashboard, it is no longer possible to change its color scheme. In the customize panel, the color scheme dropdown displays the warning:

The color scheme is determined by the related dashboard. Edit the color scheme in the dashboard properties.

And disabled the dropdown via this code: https://github.com/apache/superset/blob/594d3e0e0c4add06c1216490c63cdc6ac43e2f5a/superset-frontend/src/explore/components/controls/ColorSchemeControl/index.tsx#L111-L121

However, if the dashboard does not have a color scheme selected (or it's been cleared), the chart's color scheme is still respected (you can see this by selecting a color scheme for a chart before assigning it to a dashboard without a color scheme). In this situation, it does make sense to change the chart's color scheme, and so the dropdown shouldn't be disabled (the warning could still be shown though).

How to reproduce the bug

  1. Create a chart not associated with any dashboard
  2. Set its color scheme to something that's not the default.
  3. Create a dashboard. Do not set its color scheme (or set it to "" in the JSON config).
  4. Add the chart to the dashboard. Notice that it still renders with the chosen color scheme.
  5. Go to the chart's "Customize" tab. Notice that you cannot change its color scheme (nor is its current color scheme shown).

Expected results

Since the dashboard has no color scheme set, and the chart's color scheme is thus used, I expect to be able to change it.

Actual results

I am unable to change the chart's color scheme except by removing it from the dashboard, changing the color scheme, and adding it back.

Environment

(please complete the following information):

  • browser type and version: Firefox 112.0.1.
  • superset version: Hosted custom build, so I'm not 100% sure. I think it's close to master.
  • python version: Hosted, so unknown.
  • node.js version: Hosted, so unknown.
  • any feature flags active: Hosted, so unknown.

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

I can't for the life of me find the exact point in the code where dashboard color scheme is chosen over the chart color scheme when the former is set, but I'm pretty sure that code is going to show that if the dashboard color scheme is unset (or ""), then the chart color scheme will be used.

jonhoo avatar Apr 28 '23 22:04 jonhoo

Any update/workaround on this issue? Im facing the same problem

cshami avatar Aug 31 '23 16:08 cshami

+1. I also don't have any color scheme specified on dashboard level, but chart level scheme is still block. As a workaround, when I need to change color scheme of the chart, I delete chart from dashboard, edit its color scheme and then add back.

maratbakiev2 avatar Sep 14 '23 11:09 maratbakiev2

+1; I updated to version 3.0.0rc4 and when I clear the dashboard color scheme and save, it appears that it still blocks the chart level. I also noticed that the dashboard reverts back to having a color scheme despite having cleared and saved it – though perhaps this is another issue.

jess-goddard avatar Sep 15 '23 14:09 jess-goddard

It's been a while since this issue was commented on, but I believe this is still an issue in current master. CC @geido who I believe has this on a punch list of things to tackle in the dashboard color palette project he's working on.

rusackas avatar Mar 12 '24 19:03 rusackas

Thanks. I am looking into this

geido avatar Mar 15 '24 18:03 geido

We are also facing the same issue- Everytime we refresh the dashboard- The chart color is getting changed- We tried clearing the color scheme of Dashboard but it is not getting reflected, for this reason we are unable to change the color scheme of the chart as well

hk-the-analyst avatar Apr 02 '24 05:04 hk-the-analyst

Any update on this issue?

OrwaRebootMob avatar Jun 03 '24 08:06 OrwaRebootMob

This is still an issue AFAIK.

rusackas avatar Jun 03 '24 18:06 rusackas

Is there anyone working on the issue at the moment?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Evan Rusackas @.> Sent: Monday, June 3, 2024 8:09:16 PM To: apache/superset @.> Cc: Orwa Diraneyya @.>; Comment @.> Subject: Re: [apache/superset] Cannot set color scheme for dashboard-associated chart even when dashboard color scheme is cleared (Issue #23874)

This is still an issue AFAIK.

— Reply to this email directly, view it on GitHubhttps://github.com/apache/superset/issues/23874#issuecomment-2145825744, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFZDGTYLTGEAGAHOEGEQIRDZFSWMZAVCNFSM6AAAAAAXPX76F6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVHAZDKNZUGQ. You are receiving this because you commented.Message ID: @.***>

OrwaRebootMob avatar Jun 03 '24 21:06 OrwaRebootMob

Is there anyone working on the issue at the moment?

Not that I'm aware of... go for it!

rusackas avatar Jun 04 '24 16:06 rusackas

This is not prioritized still. It would be good for someone to pick this up. Marked this as a good first issue

geido avatar Jun 26 '24 15:06 geido

Hi @geido, I would like to work on the issue.

Can you please guide me on where I should start looking in the codebase?

Rohitpandey357 avatar Sep 22 '24 11:09 Rohitpandey357

This is not prioritized still. It would be good for someone to pick this up. Marked this as a good first issue

Hey @Rohitpandey357 join me on Apache Superset Slack. I am Diego Pucci in there. Let's plan around this. Happy to get you up and running with this!

geido avatar Sep 25 '24 16:09 geido