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

error while trying to change min/max vertical axis on Candlestick Series

4 Answers 77 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 18 Jul 2012, 11:16 AM
I only get this some times (making it more annoying), but it seems like a bug in the OhlcSeriesRoundLayoutContext.SnapPointToGrid functionality. I need to be able to change the min/max of the vertical axis. Is there any way to turn off the snapping behaviour so it doesn't try to do it and thus doesn't break? Or is this something else doing it? I need to get this working rather soon. 


exception attached:

System.ArgumentOutOfRangeException was unhandled
  Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  Source=mscorlib
  ParamName=index
  StackTrace:
       at System.ThrowHelper.ThrowArgumentOutOfRangeException()
       at System.Collections.Generic.List`1.get_Item(Int32 index)
       at System.Collections.ObjectModel.Collection`1.get_Item(Int32 index)
       at Telerik.Charting.OhlcSeriesRoundLayoutContext.SnapToLowGridLine(OhlcDataPoint point)
       at Telerik.Charting.OhlcSeriesRoundLayoutContext.SnapPointToGrid(OhlcDataPoint point)
       at Telerik.Charting.OhlcSeriesModel.ApplyLayoutRounding()
       at Telerik.Charting.CartesianChartAreaModel.ApplyLayoutRounding()
       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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(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()
       at MyApplication.App.Main() in D:\Work\MyApplication\MyApplication
\obj\x86\Debug\App.g.cs:line 0
  InnerException: 

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 Jul 2012, 08:35 AM
Hi Dan,

Could you, please, elaborate a bit more on your specific scenario, as we've been unable to reproduce this issue in our local tests, so perhaps we are missing some of the details. Do you set Min and Max values for the axis initially and then update them on a button click or a similar action? Please, find attached a sample test application, which we've prepared to test this scenario. It would be very helpful for us if you're able to have a look at it and modify it if needed so that the issue is reproducible, then send it back to us to debug.

Any additional information on your scenario, chart settings and how you update the axis values would also be greatly appreciated.

Regards,
Nikolay
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Dan
Top achievements
Rank 1
answered on 19 Jul 2012, 01:46 PM
I recreated the scenario in your code. First thing I discovered is that it's apparently data, dependent, this break. I found some randomly generated data that does break it though and saved the data to a text file. Breaks every time. I use a datetimecategoricalaxis, and PanZoom behaviour. What my actual project does is dynamically change the y axis min/max depending on what data is in the screen to fill most of the screen whatever is being shown. This is not necessary to break it. I wired the panOffset so that whenever it changes, the y minmax changes with it and that makes it break in my dummy project. As for attaching it.. How? This only lets me attach pictures.
0
Dan
Top achievements
Rank 1
answered on 19 Jul 2012, 02:57 PM
Sent the zip file with my modifications back. Support ticket #567289
0
Evgenia
Telerik team
answered on 24 Jul 2012, 09:54 AM
Hi Dan,

 Since you've been already answered in the support thread started by you on the same topic, I'm copying the answer here for anyone else that may happen upon this forum thread:

"We have been able to reproduce the issue on our side and it has been logged for our developers to investigate and provide a fix for one of the upcoming LIB releases."

Kind regards,
Evgenia
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Thoerle
Top achievements
Rank 1
commented on 13 May 2022, 12:08 PM

Too bad this issue is still present ... 10! years after it got reported.

We run into the same issue:

 

at System.ThrowHelper.ThrowArgumentOutOfRange_IndexException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Telerik.Charting.CategoricalSeriesRoundLayoutContext.SnapPointToGridLine(CategoricalDataPoint point)
   at Telerik.Charting.CombinedBarSeriesRoundLayoutStrategy.ApplyLayoutRoundingVertical(LayoutContext context)
   at Telerik.Charting.CombinedBarSeriesRoundLayoutStrategy.ApplyLayoutRoundingVertical(CombinedSeries series)
   at Telerik.Charting.CombinedBarSeriesRoundLayoutStrategy.ApplyLayoutRounding(ChartAreaModel chart, CombinedSeries series)
   at Telerik.Charting.ChartSeriesCombineStrategy.ApplyLayoutRounding(ChartAreaModel chartArea)
   at Telerik.Charting.CartesianChartAreaModel.ApplyLayoutRounding()
   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.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
Martin Ivanov
Telerik team
commented on 16 May 2022, 10:54 AM

The originally reported issue was resolved back in 2012. This is probably related, but it seems to reproduce in a different context. This said, would it be possible to send over some code snowing your setup along with the sample data that breaks the chart? A runnable project reproducing the issue will be useful.
Tags
ChartView
Asked by
Dan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Dan
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or