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);
- when the MajorDivCount reaches 0 (zero), the programme freezes ("Program not responding"). It will not recover.
Last visible 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;
}
Regards, Andreas