apexcharts-flow icon indicating copy to clipboard operation
apexcharts-flow copied to clipboard

Theme issue when chart is on initial page

Open F43nd1r opened this issue 5 years ago • 2 comments

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: DeepinBildschirmfoto_Bereich auswählen_20191214014900

Added later to UI (expected): DeepinBildschirmfoto_Bereich auswählen_20191214014444

Please delay color computation until the theme is fully loaded.

F43nd1r avatar Dec 14 '19 00:12 F43nd1r

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.

appreciated avatar Dec 14 '19 10:12 appreciated

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)")

F43nd1r avatar Apr 19 '21 00:04 F43nd1r