"System.OverflowException Arithmetic operation resulted in an overflow" when rendering chart

I keep getting this error when rendering some of my chart through StateIsChanged(). I am calculating my range automatically, which could be set after data has been loaded.
For some reason the visual range of my YAxis is NaN. I could use some help understanding what could be causing this.

Line: 30
System.OverflowException: Arithmetic operation resulted in an overflow.
   at System.Convert.ToInt64(Double value)
   at Syncfusion.Blazor.Charts.Internal.LineBaseSeriesRenderer.GetLineDirection(Double firstPointX, Double firstPointY, Double secondPointX, Double secondPointY, Boolean isInverted, String startPoint)
   at Syncfusion.Blazor.Charts.Internal.LineSeriesRenderer.CalculateDirection()
   at Syncfusion.Blazor.Charts.Internal.LineSeriesRenderer.RenderSeries()
   at Syncfusion.Blazor.Charts.Internal.ChartSeriesRenderer.SeriesRenderer()
   at Syncfusion.Blazor.Charts.Internal.ChartSeriesRenderer.HandleChartSizeChange(Rect rect)
   at Syncfusion.Blazor.Charts.Internal.ChartSeriesRendererContainer.HandleChartSizeChange(Rect rect)
   at Syncfusion.Blazor.Charts.SfChart.PerformLayout()
   at Syncfusion.Blazor.Charts.SfChart.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)


1 Reply 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team September 30, 2024 10:53 AM UTC

Hi Andrew,


Thanks for using Syncfusion products.


We have reviewed the console exception you reported and validated the scenario. You can dynamically update the range based on the data provided for the chart. We recommend avoiding the use of NaN values for y-axis properties such as minimum, maximum, and interval in your application to prevent this issue. If you have any further concerns, please let us know.


Regards,

Durga Gopalakrishnan.



Marked as answer
Loader.
Up arrow icon