We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

setTheme not found


Hi,


I have done the method describe in the following for server side app: 

NET6 Blazor Server side Theme switcher not applied to page. | Blazor Forums | Syncfusion


But I get the following error: 


An exception of type 'Microsoft.JSInterop.JSException' occurred in System.Private.CoreLib.dll but was not handled in user code

Could not find 'setTheme' ('setTheme' was undefined).

Error: Could not find 'setTheme' ('setTheme' was undefined).


1 Reply

MS Monisha Saravanan Syncfusion Team October 12, 2022 05:29 AM UTC

Hi Thaban,


Greetings from Syncfusion.


We set the theme for the chart by using the Theme property in the chart. We have created a simple blazor application using the Chart and the dropdown. Based on the dropdown value, we can set the theme for the Chart. Please find the below sample link for your reference.


Sample link:  https://www.syncfusion.com/downloads/support/directtrac/general/ze/ChartSwitchTheme1638184057


Code Snippet:


<SfChart Title="Crude Steel Production Annual Growth" Theme="@theme"></SfChart>


Screenshot:



Kindly, revert us if you have any concerns.


Regards,

Swetha


Loader.
Live Chat Icon For mobile
Up arrow icon