This is a migrated thread and some comments may be shown as answers.

Chart crashes when loaded with big amount of data.

6 Answers 121 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Laurent
Top achievements
Rank 1
Laurent asked on 30 Sep 2015, 07:16 PM

I am still in the process of evaluating the Telerik WPF package. Everything was OK with the Chart component until I found this problem.

 When loaded with plenty of data, the chart crashes with the following exception :

Decimal too big or too small

   at System.Decimal..ctor(Double value)
   at System.Decimal.op_Explicit(Double value)
   at Telerik.Charting.LinearAxisModel.<GenerateTicks>d__0.MoveNext()
   at Telerik.Charting.AxisModel.<Delay>d__1e`1.MoveNext()
   at Telerik.Charting.AxisModel.TryBuildNonOverlappingTicksAndLabels(Boolean buildLabels, ValueRange`1 zoomRange, Boolean allowOverlappingLabels)
   at Telerik.Charting.NumericalAxisModel.ChooseActualRange()
   at Telerik.Charting.NumericalAxisModel.BeginMeasureCore(RadSize availableSize)
   at Telerik.Charting.AxisModel.MeasureCore(RadSize availableSize)
   at Telerik.Charting.AxisModel.Measure(RadSize availableSize)
   at Telerik.Charting.NumericalAxisModel.Measure(RadSize availableSize)
   at Telerik.Charting.CartesianChartAreaModel.AxisStack.Measure(RadSize availableSize)
   at Telerik.Charting.CartesianChartAreaModel.PrepareAxesStacks(RadSize availableSize)
   at Telerik.Charting.CartesianChartAreaModel.ArrangeAxes(RadRect availableRect)
   at Telerik.Charting.ChartAreaModelWithAxes.UpdateAndArrangeAxes(SeriesByAxesTuple seriesByAxes, RadRect availableRect, RadRect& seriesRect)
   at Telerik.Charting.ChartAreaModelWithAxes.ArrangeOverride(RadRect rect)
   at Telerik.Charting.ChartNode.Arrange(RadRect rect, Boolean shouldRoundLayout)
   at Telerik.Charting.ChartAreaModel.Arrange()
   at Telerik.Windows.Controls.ChartView.RadChartBase.UpdateChartArea()
   at Telerik.Windows.Controls.ChartView.RadChartBase.CallUpdateUI()
   at Telerik.Windows.Controls.ChartView.RadChartBase.OnInvalidated()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()

Known problem? Any workaround?

6 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 05 Oct 2015, 07:49 AM
Hi Laurent,

From the stack trace you provided it seems that the data you have contains very large values. The chart does some calculations with the values of the items in order to calculate a range and it appears that the double value is too large to fit into a decimal value and an exception is thrown (we use decimal values for bigger precision). I suggest you check if indeed there is a very large value. If this is the case, there is not much you can do but somehow eliminate such large values. One way to go is to divide all values by 1000000 and indicate that the values shown are in millions.

Let us know if you need more information.

Regards,
Petar Marchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Laurent
Top achievements
Rank 1
answered on 05 Oct 2015, 05:06 PM

The values sent to chart are all ​the range of  -30 to +30. I added some extra code to check for that. 

Trouble does happen when I send about 50000 values to the chart, 40000 works. 

 Looking at the stack trace it seems like this is an issue with creating tick marks on the axis.

0
Laurent
Top achievements
Rank 1
answered on 05 Oct 2015, 05:18 PM

I forgot to mention: This is happening with the trial version, the 2015 Q2 release.

And using VS 2015 on Windows 10.

0
Petar Marchev
Telerik team
answered on 06 Oct 2015, 08:45 AM
Hi Laurent,

We were unable to reproduce the issue at hand. I am attaching a small project for your reference. If you need our assistance I will ask that you update it and send it back to us so that we can look into it. Thank you for understanding.

Regards,
Petar Marchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Laurent
Top achievements
Rank 1
answered on 06 Oct 2015, 05:21 PM

Thanks I will look into this project later today.

 I really do not "like" that the chart component is restricted to the decimal range. There are many math and science use cases where a much larger dynamic range is required. Does Telerik have any plans to support the full double fp numeric range?

0
Petar Marchev
Telerik team
answered on 09 Oct 2015, 07:38 AM
Hi,

We do not have any immediate plans to modify the chart's engine in this direction. Let us know when you manage to create a small project reproducing the issue at hand.

Regards,
Petar Marchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Laurent
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Laurent
Top achievements
Rank 1
Share this question
or