Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all articles
Browse latest Browse all 2061

New Post: System.NullReferenceException while trying to pan before the chart is plotted

$
0
0
I think i have an issue with something related to this.
<Exception><ExceptionType>System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Referencia a objeto no establecida como instancia de un objeto.</Message><StackTrace>   en OxyPlot.ScreenPointHelper.FindNearestPointOnPolyline(ScreenPoint point, IList`1 points) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\Rendering\ScreenPointHelper.cs:línea 56
   en OxyPlot.Annotations.PathAnnotation.HitTest(ScreenPoint point, Double tolerance) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\Annotations\PathAnnotation.cs:línea 424
   en OxyPlot.PlotModel.HandleMouseDown(Object sender, OxyMouseEventArgs e) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\PlotModel\PlotModel.MouseEvents.cs:línea 86
   en OxyPlot.WindowsForms.Plot.OnMouseDown(MouseEventArgs e) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot.WindowsForms\Plot.cs:línea 397
   en System.Windows.Forms.Control.WmMouseDown(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   en System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   en QCEP.Program.Main() en c:\Users\gbaquedano\Documents\Visual Studio 2013\Projects\QCEP\QCEP\Program.cs:línea 20
   en System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   en System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
   en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
   en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   en System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
   en OxyPlot.ScreenPointHelper.FindNearestPointOnPolyline(ScreenPoint point, IList`1 points) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\Rendering\ScreenPointHelper.cs:línea 56
   en OxyPlot.Annotations.PathAnnotation.HitTest(ScreenPoint point, Double tolerance) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\Annotations\PathAnnotation.cs:línea 424
   en OxyPlot.PlotModel.HandleMouseDown(Object sender, OxyMouseEventArgs e) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot\PlotModel\PlotModel.MouseEvents.cs:línea 86
   en OxyPlot.WindowsForms.Plot.OnMouseDown(MouseEventArgs e) en c:\TeamCity\buildAgent\work\3b9fcf1ba397d0ed\Source\OxyPlot.WindowsForms\Plot.cs:línea 397
   en System.Windows.Forms.Control.WmMouseDown(Message&amp;amp; m, MouseButtons button, Int32 clicks)
   en System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
Issue happens when you click the plot when it is drawing and hasn't finished. The click event gets triggered even the model is not fully updated.
If you wait for it to finish (like 100ms in my current test) you dont get the crash.

Viewing all articles
Browse latest Browse all 2061

Trending Articles