apexcharts-flow
apexcharts-flow copied to clipboard
Theme issue when chart is on initial page
A chart in a UI with a theme variant, e.g. lumo-dark will only be themed correctly if it is not on the initial page.
Loading in initial layout:
Added later to UI (expected):
Please delay color computation until the theme is fully loaded.
As a workaround you can set a color manually. Computed Styles are tricky not sure if there actually is a good solution to this issue.
Giving a little update on this issue:
- This issue only exists when dynamically setting the theme variant using
setAttribute
on the UI. (not when using annotations) - Here's my workaround (call after adding chart to UI)
chart.getElement().executeJs("setTimeout(() => { this.updateConfig(); this.chartComponent.updateOptions(this.config); this.chartComponent.render() }, 0)")