apache / apache/superset

Some dashboard charts intermittently fall back to color_scheme instead of label_colors on initial render

Open
#40,708 7 comments 0 reactions 0 assignees View on GitHub
dashboard:colors validation:required
Dominant language
Python
Stars
74.8k
Forks
18.3k
Avg merge
2d 5h
Merged PRs (30d)
685

Description

### Bug description

When using `label_colors` in dashboard JSON metadata, some charts intermittently do not apply the defined colors in "label_colors" and instead fall back to the chart's default `color_scheme` on initial render.

This issue does not affect all charts consistently:
- Most of the charts correctly apply `label_colors`
- Some charts (often the first one) fall back to the default color scheme
- The behavior is highly intermittent and not reproducible on every page load

---

### Observed behavior

- Only some charts are affected, while others display correct colors
- After user interaction (e.g. clicking legend or refreshing the page), the colors become correct

---

### Expected behavior

All charts should consistently apply the `label_colors` defined in dashboard metadata on initial render.

---

### Dashboard label_colors configuration

The dashboard uses the following `label_colors` configuration:

```json
{
"label_colors": {
"60_Crashed": "#8b0000",
"50_Error": "#ff0000",
"40_Failed": "#ff8c00",
"30_Undefined": "#ffd700",
"20_Passed": "#008000",
"10_Executed": "#0000ff",
"01_Invalid": "#ff00ff",
"00_NoResult": "#808080"
}
}
```
Dashboard-level color_scheme is empty, the charts use "supersetColors" as color_scheme.

---

### Screenshots/recordings

The following screenshot shows the case when the issue occurs

Image

After refreshing or clicking legend, the colors become correct

Image

---
### Superset version

6.0.0

---

### Python version

I don't know

### Node version

I don't know

### Browser

Chrome

### Additional context

I have reviewed similar issues related to color assignment and dashboard behavior (e.g. #36406), but I could not find a case fully matching this behavior (intermittent fallback to `color_scheme` with `label_colors` defined).

Based on the observed behavior, it seems likely that this is related to rendering order or timing in the frontend. However, this is only a hypothesis.

I would appreciate confirmation from maintainers whether this is an expected limitation, a known issue, or a bug in the current rendering pipeline. Thanks.
``

### Checklist

- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named. Start by reproducing the dashboard's initial render with the provided label_colors configuration, then trace how chart colors are resolved before and after legend interaction. Done means every chart applies label_colors consistently on its first render, with a regression test for the intermittent fallback.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.