Stock chart throws exception on initial render

Hi,

I'm trying out the Stock chart control and I am unable to get it working on later nuget versions. Just adding the tag makes the circuits break (serverside Blazor). Tried some samples from other posts here on the forum and they work as long as the versions are much older. Any help appreciated.



[2022-01-01T15:35:51.893Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.

   at Syncfusion.Blazor.Charts.SfRangeNavigator.ResizeChart()

   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__127_0(Object state)

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

--- End of stack trace from previous location ---

   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)

log @ blazor.server.js:1



Attachment: SyncfusionBlazorApp2_5510eb4e.zip

1 Reply

DG Durga Gopalakrishnan Syncfusion Team January 3, 2022 12:38 PM UTC

Hi Olsson,


Greetings from Syncfusion.


We have validated your reported console error with attached sample. We suggest you to refer the below script in _Layout.cshtml page to overcome the problem. We have attached the modified sample for your reference. Please check with below snippet and UG link.


<head>

    <script src="~/scripts/lodash.min.js"></script>

    <script src=https://cdn.syncfusion.com/blazor/syncfusion-blazor-base.min.js></script>

</head>


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/StockChart647792418.zip


UG : https://blazor.syncfusion.com/documentation/chart/chart-dimensions


Please revert us if you have any concerns.


Regards,

Durga G


Loader.
Up arrow icon