Charts: System.NullReferenceException: Object reference not set to an instance of an object.

Dear Customer Support,

I am running into this error shown below when rendering chart as shown in the code below.


I am using MoneyMovementDtos for a Grid table which works fine wo issues.

However the MoneyMovementGroupedByTypedDtos which is used in the Chart always throw this error shown below. The Chart does render eventually, except it also throws on the webpage the "unhandled exception has occurred" error. I am using package version :<PackageReference Include="Syncfusion.Blazor.Cards" Version="19.4.0.53" />

Thank you for your help.

 Capture.PNG




1 Reply 1 reply marked as answer

SB Swetha Babu Syncfusion Team February 25, 2022 01:30 PM UTC

Hi  John, 

Greetings from Syncfusion. 

When we analyzed the provided sample code and came to know that you have created the ChartArea outside the SfChart. Please add that ChartArea inside the SfChart. We have created the simple blazor application using the provided code snippet and the same can be downloaded from the below link. 


In the above sample, we have rendered the chart component inside the layout component. Please let us know if the above sample meets your requirement. 

Kindly, revert us if you have any concerns. 

Regards, 
Swetha

Marked as answer
Loader.
Up arrow icon