Dark themes not working with Charts

I tested dynamic changing of themes from this repo with Charts but it's not working. The dark themes are not having an effect on Charts. The dark theme is having effects on grid control but not charts.



Find the attached sample project.


Attachment: themeswitchinginblazorWASMappNet6_f48c8c24.zip

3 Replies

DG Durga Gopalakrishnan Syncfusion Team May 25, 2022 03:01 PM UTC

Hi Moses,


Greetings from Syncfusion.


We have ensured your reported scenario by changing the theme for chart dynamically. Chart themes are updated properly as per behavior. Please check with the below screenshots and sample.


<SfChart Theme="@Theme"> </SfChart>

@code{

public Theme Theme = Theme.Material;

public void OnThemeChange(MouseEventArgs args)

    {

       Theme = Theme.FabricDark;

    }

}


Material


FabricDark :



Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/ChartTheme-351527043.zip


Kindly revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.



SE Sergiush replied to Durga Gopalakrishnan July 24, 2022 10:09 AM UTC

Ok. All works fine. But what if I want to change the theme of chart from any theme switcher on MainLayout.razor?

Thanks in advance,

Sergiusz



DG Durga Gopalakrishnan Syncfusion Team July 25, 2022 01:32 PM UTC

Hi Moses,


You can access the chosen theme from theme switcher method and assign the corresponding theme to chart Theme property to apply the changes.


Please revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.


Loader.
Up arrow icon