Setting chart line series style and color not working when using setStyleMode(true)

When I do conf.getChart().setStyledMode(true); in Vaadin Flow 24.x, the code that tries to change a chart’s series’ line style or color does not work, e.g,

plotOptions.setDashStyle(DashStyle.SOLID);
plotOptions.setColor(SolidColor.RED);

I am using setStyleMode(true) because I’m usking “dark theme”, and without that setting, everything looks very off (e.g, white bacground chart etc.). Is there a way I can get the “look” that I want (which I do get when I set setStyleMode(true) but still also have control over a chart’s serie’s line style an color etc.?

Are you applying the correct configuration to your charts so that dark mode works?

For example

ChartOptions.get().setTheme(new LumoDarkTheme());

I don’t know of any problems regarding dark theme. I would highly suggest to get rid of your style mode if you wanna use the java api.

1 Like

That seems to have worked! Thanks!