Bug description
When using dark mode, charts are rendered without visible axis labels and other chart text elements. This appears to be due to the labels not switching to a lighter color (e.g., white), making them effectively invisible against the dark background.
Steps to Reproduce
- Switch to dark mode.
- Open any chart (e.g., bar chart, line chart, etc.).
Screenshots/recordings
Superset version
master / latest-dev
Python version
3.11
Node version
18 or greater
Browser
Chrome
Additional context
No response
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.
Comment From: dosubot[bot]
This regression is likely due to recent theming changes: Superset now uses Ant Design v5's token-based theming and dynamic dark mode, but the ECharts plugin isn't always applying theme tokens for axis label and text color in a way that updates reactively with theme changes. In particular, axis label color is not always set explicitly from the current theme, so when you switch to dark mode, labels can remain dark and become invisible against the background. The relevant code is in the Echart.tsx and transformProps.ts files, where theme tokens like colorText and colorTextSecondary should be used for axisLabel.color and textStyle.color, but in some chart types this isn't handled or is based on a static theme snapshot rather than the live context [source].
There isn't any documentation on customizing theme tokens specifically for this, but you can try setting THEME_DARK in your superset_config.py to ensure the dark algorithm is used, or use the theme editor (if enabled) to tweak color tokens. For a code fix, updating the ECharts plugin to always set axisLabel.color and textStyle.color from the live theme context (using useTheme) should resolve the issue. This is a new regression and representative of a broader architectural gap in theme token propagation [source].
If you want to try a local fix or need pointers to the relevant code, let me know!
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: msyavuz
Hey, @gabotorresruiz This pr seems to cause this regression, can you take a look?
Comment From: gabotorresruiz
Hey @msyavuz @HarshithGamini, thanks for finding this. Here's the PR with the fix --> https://github.com/apache/superset/pull/34218