ViewPolar: !KeepDivCountOnRangeChange, Zoom

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
ahe
Posts: 51
Joined: Tue Aug 11, 2015 4:33 pm
Location: Düsseldorf, DE

ViewPolar: !KeepDivCountOnRangeChange, Zoom

Post by ahe » Wed Aug 12, 2015 7:52 am

Hello,

I would like to report a possible bug.

I encountered a freeze of my WinForms programme when disabling KeepDivCountOnRangeChange and zooming into the axis by mouse. When the MajorDivCount reaches zero, the programme freezes.

Steps to reproduce
- new Project, add a new LightningChartUltimate
- add the following code to Form's contructor after InitializeComponents();

Code: Select all

            var chart = lightningChartUltimate1;
            chart.ActiveView = ActiveView.ViewPolar;

            var view = chart.ViewPolar;
            view.MouseWheelAxisAction = AxisMouseWheelAction.Zoom;

            var axis = view.Axes[0];
            axis.KeepDivCountOnRangeChange = false;

            var pls = new PointLineSeriesPolar(view, axis);
            pls.PointsVisible = true;
            pls.LineVisible = true;
            var plp = new PolarSeriesPoint[2];
            plp[0].Angle = 45;
            plp[0].Amplitude = 5;
            plp[1].Angle = 55;
            plp[1].Amplitude = 4;
            pls.Points = plp;
            view.PointLineSeries.Add(pls);
- start the programme, zoom into the axis (hover over the axis, use mouse wheel)
- when the MajorDivCount reaches 0 (zero), the programme freezes ("Program not responding"). It will not recover.

Last visible image:
Image

Output is empty, i.e. no exceptions are recorded, even with chart.ThrowChartExceptions = true;


My workaround for this is to reset the MajorDivCount before it gets into the critical range:

Code: Select all

        // axis.RangeChanged += axis_RangeChanged;

        private void axis_RangeChanged(double newMin, double newMax, AxisPolarBase axis, ref bool cancelRendering)
        {
            if (axis.MajorDivCount < 3)
                axis.MajorDivCount = 10;
            else if (axis.MajorDivCount > 20)
                axis.MajorDivCount = 10;
        }
Version: LightningCharts Ultimate 6.5.1 (July 31st, 2015)

Regards, Andreas

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: ViewPolar: !KeepDivCountOnRangeChange, Zoom

Post by ArctionPasi » Thu Aug 13, 2015 3:42 pm

Hi Andreas,

thanks for reporting this problem. We have now prevented this freeze from happening. :?

The fix will be included in the next assembly pack in couple of weeks.
LightningChart Support Team, PT

Post Reply