I'm using the TeeChart NET 2014 4.1.2014.02060 inside a WPF-UserControl. And causing the following Exception.
Code: Select all
System.IndexOutOfRangeException wurde nicht behandelt.
HResult=-2146233080
Message=Index was outside the bounds of the array.
Source=TeeChart.WPF
StackTrace:
at Steema.TeeChart.WPF.Styles.Series.CalcXPos(Int32 index)
at Steema.TeeChart.WPF.Tools.NearestPoint.PaintHint()
at Steema.TeeChart.WPF.Tools.NearestPoint.ChartEvent(EventArgs e)
at Steema.TeeChart.WPF.Chart.BroadcastToolEvent(EventArgs e)
at Steema.TeeChart.WPF.Chart.InternalDraw(DrawingContext g, Boolean noTools)
at Steema.TeeChart.WPF.TChart.Draw(DrawingContext g)
at Steema.TeeChart.WPF.TChart.OnRender(DrawingContext drawingContext)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
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.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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, 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 CWinThread.Run(CWinThread* )
at AIS.VAC.Sys.Runtime.CIFDispatcher.Run(CIFDispatcher* )
Before removing old Points and adding new ones from the FastLine, I deactivate the NearestPointtool by setting NearestPoint.Active = false and NearestPoint.Series = null.
After adding the new points I set the NearestPoint.Series to the new FastLine and NearestPoint.Active = true.
Then the Exception occurs.
When not setting the NearestPoint.Active = true everything runs well. The Exception also occurs only when the NearestPoint-Marker was displayed on the Chart.
Is there a workaround available for this bug?
Best regards
Franz