GitHub user VectorPeak added a comment to the discussion: ECharts Configuration 
Overrides not working for me.

This usually points to Superset not rendering with the theme object you think 
it is using, rather than ECharts ignoring the option itself.

The first thing I would check is the interaction with 
`ENABLE_UI_THEME_ADMINISTRATION=True`. Once theme administration is enabled, 
the active theme can come from the metadata DB / UI-managed theme 
configuration. In that case, changing `THEME_DEFAULT` in `superset_config.py` 
may not affect dashboards that are already using a UI-managed theme. As a quick 
test, either temporarily disable theme administration or add the same 
`echartsOptionsOverrides` directly to the active theme in the UI and refresh 
the dashboard.

A good debugging pattern is to start with an intentionally obvious global 
override, not a subtle chart-type-specific one:

```python
THEME_DEFAULT = {
 "themeName": "Custom theme",
 "echartsOptionsOverrides": {
 "backgroundColor": "#ffefef",
 "animation": False,
 "textStyle": {
 "fontFamily": "Arial",
 },
 },
 "echartsOptionsOverridesByChartType": {
 "echarts_timeseries_line": {
 "grid": {
 "left": 80,
 "right": 40,
 },
 },
 },
}
```

If `backgroundColor` or `animation` is not changing, the theme override is 
probably not being loaded at all. If the global override works but 
`echartsOptionsOverridesByChartType` does not, then the chart type key is 
probably the issue. The keys need to match the chart plugin / `viz_type`, not 
necessarily the human-readable chart name. For example, a Time-series Line 
chart may not be keyed as just `"line"`.

A few concrete things worth checking:

- Confirm the dashboard is using the theme you edited, especially if themes are 
managed through the UI.
- Restart the Superset web process after changing `superset_config.py`; in 
Docker/Kubernetes, also make sure the updated config is actually mounted into 
the running container.
- Hard-refresh the browser or clear frontend cache after changing theme config.
- Try a global `echartsOptionsOverrides` first, then add 
`echartsOptionsOverridesByChartType` once the global override is visible.
- Check the chart’s actual `viz_type` from the chart metadata / Explore URL / 
saved chart JSON and use that exact value as the chart-type key.
- Make sure the chart is actually ECharts-based; some visualizations may not go 
through the ECharts override path.

One subtle point: if a theme has already been created or selected via UI theme 
administration, updating `THEME_DEFAULT` may only change the configured 
default, not overwrite the existing stored theme. In that setup, the safer path 
is to edit the active theme through the theme administration UI, or 
delete/recreate the stored theme if you want it to be seeded again from config.

If it still does not apply, the most useful details would be the exact 
`THEME_DEFAULT` block, the chart type you are testing against, and whether the 
same override works when placed on the active UI-managed theme. That should 
make it pretty clear whether this is a theme-selection issue, a chart-type-key 
mismatch, or a specific override being overwritten later by the chart plugin.

---
If my answer solved your problem, you can click **answered the question**. I'm 
really here to help, and along the way I'm also collecting Galaxy Brain badges 
haha đŸ˜†

GitHub link: 
https://github.com/apache/superset/discussions/41620#discussioncomment-17555551

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to