Open sirockin opened 1 year ago
Some further information which may be useful:
updateOptions()
and render()
directly on the ChartComponent object (obtained via @ViewChild()
) and this does not help.Looking further, I can see that the issue seems to be that chart.foreColor
and chart.background
automatically get set to "#f6f7f8" and "#424242" when the theme is changed to "dark" but do not get set back to undefined
when the theme changes back. So a workaround is to explicitly do that when changing the theme from "dark" to "light".
Same thing seems to happen with most/all the charts from what I can tell, I seem to need to change the forecolor and background options directly alongwith the mode changes.
Looking further, I can see that the issue seems to be that
chart.foreColor
andchart.background
automatically get set to "#f6f7f8" and "#424242" when the theme is changed to "dark" but do not get set back toundefined
when the theme changes back. So a workaround is to explicitly do that when changing the theme from "dark" to "light".
I can confirm a similar behavior in the react package
Is there any update on this - apols for bumping but it still seem to be an issue
Still occurring to this day.
Using Debian 12 with
Happens whether that's by directly the ChartOptions the object is bound to or calling updateOptions via @ViewChild. Could you please address?
Introduction
As this sandbox shows, setting the theme property to
{mode:'dark'}
will instantly change the chart to dark mode, but setting it back by setting{mode:'light'}
does not work. (Nor does setting it to `{mode:'undefined'}Expected Behaviour
Changing
themes.mode
from'dark'
to'light'
should instantly change all the chart's colors to the light theme.Actual Behaviour
The chart appears to redraw and the line changes color back to that of the light theme, but the rest of the chart (background and text colors) remain those of the dark theme.