Profile Picture

Crash when zooming chart (in obscure circumstances)

Posted By Kevin Harrison 11 Years Ago
Author
Message
Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

Hi

It is possible for my users to kick off redrawing of a chart while they are in the middle of a zoom (don't ask, I have to defend against this sort of stuff all the time). If this happens then I get  "Object reference not set to an instance of an object" and the partial stack trace:

   at Nevron.Chart.NNumericAxisPagingView.ConfigureAxisPagingInternal(NRange1DD range, Boolean allowAutoEnable)
   at Nevron.Chart.NAxisPagingView.ZoomIn(NRange1DD axisRange, Double dMinPageSize, Boolean l1ll11lIlIl)
   at Nevron.Chart.NAxisPagingView.ZoomIn(NRange1DD axisRange, Double dMinPageSize)
   at Nevron.Chart.l1l1lI1I1II.l1l1IIlIlI1(Double factor)
   at Nevron.Chart.lIl1lIII1l.Process(Double factor, NAnimationService service)
   at Nevron.Chart.l1lIl1llIIl.Process(NAnimationService service)
   at Nevron.Chart.NAnimationService.OnTimerTick()
   at Nevron.Chart.NTimer.OnTimerTick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

It's an obscure edge case, but is it possible for you to add a null check in the code, or tell me how to implement an override. I already have a customised NDataZoomTool if there is anything I can access to check in the OnEndDrag method. I've tried

                ArrayList selectedCharts = this.GetSelectedCharts();                if (selectedCharts != null && selectedCharts[0] != null)                {                    base.OnEndDrag(sender, e);                }

but this doesn't trap the situation.

Thanks

Kevin



Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Kevin,

Can you send us the code you use in the customized zoom tool? - most likely the reason for this is that you disconnect the axis from the chart (which will leave all backreferences to null). This however can only happen if you use custom axes - is this the case? In general it will be much easier to fix the problem if we can replicate it - we can insert a try / catch that will mask this problem, but it is not a real fix...



Best Regards,
Nevron Support Team



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

Hi

What you have to do to simulate this is to start zooming, but have a button available to destroy and redraw the chart while you are doing it. Our users can press F9, which clears all existing charts and then redraws. I told you it was obscure!

I don't belive it's anything to do with my customised zoom code. All that does is check that Sihift and Control aren't pressed, and records the start and end positions of the zoom. This code executes successfully before the crash occurs.

Thanks

Kevin



Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Kevin,

Can you send the code you use to "destroy and redraw the chart" and we'll try to replicate it...



Best Regards,
Nevron Support Team



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

The code to destroy the chart is as follows:

                   nChartControl.Charts.Clear();                   nChartControl.Labels.Clear();                   nChartControl.Legends.Clear();                   nChartControl.Panels.Clear();                  nChartControl.Controller.Tools.Clear();
I can't provide the code to draw the chart - it's hundreds of lines long and intertwined with other stuff.
Is it not sufficent to know that the chart has been cleared while the redraw after the zoom is in progress?
Thanks
Kevin


Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Kevin,

The latest SP of the control fixes this issue - let us know if you meet any problems or have any questions.



Best Regards,
Nevron Support Team



Kevin Harrison
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

I confirm that the SP has fixed this issue. Many thanks as always!

Kevin





Similar Topics


Reading This Topic