Page 1 of 1

Chart.Axes.Left.CalcIncrement Error

Posted: Mon Nov 20, 2023 1:11 am
by 16595981
As far as I can ascertain, there appears to be an error in Chart.Axes.Left.CalcIncrement, which in certain cases, returns a default value of 20. I have a graph with the following values:

Code: Select all

Chart.Axes.Left.Maximum = 74;
Chart.Axes.Left.Minimum = 67;
In this case, the value of Chart.Axes.Left.CalcIncrement always returns 20.

If I swap the axes around, so that I have:

Code: Select all

Chart.Axes.Bottom.Maximum = 74;
Chart.Axes.Bottom.Minimum = 67;
Then Chart.Axes.Bottom.CalcIncrement = 2, as expected.

If I change the units of the data to Maximum = 7400 and Minimum = 6700, I get an increment of 40, as expected.

I would be pleased if you could look into this.

Regards

Errol

Re: Chart.Axes.Left.CalcIncrement Error

Posted: Mon Nov 20, 2023 3:30 am
by 16595981
With a bit more research, I found that the Left Axis was not set to Automatic scaling. When I set this, the problem went away. This was a very old setting and I assumed that manual setting of the axis scaling would override the CalcIncrement procedure. So the problem is solved.
Thanks
Errol

Re: Chart.Axes.Left.CalcIncrement Error

Posted: Mon Nov 20, 2023 7:25 am
by yeray
Hello Errol,

Directly setting Minimum and Maximum properties doesn't set Automatic, AutomaticMinimum or AutomaticMaximum properties. That's why we use to recommend calling SetMinMax(min, max) instead.