Chart.Axes.Left.CalcIncrement Error

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Errol
Newbie
Newbie
Posts: 4
Joined: Wed Jun 07, 2023 12:00 am

Chart.Axes.Left.CalcIncrement Error

Post by Errol » Mon Nov 20, 2023 1:11 am

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

Errol
Newbie
Newbie
Posts: 4
Joined: Wed Jun 07, 2023 12:00 am

Re: Chart.Axes.Left.CalcIncrement Error

Post by Errol » Mon Nov 20, 2023 3:30 am

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

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Chart.Axes.Left.CalcIncrement Error

Post by Yeray » Mon Nov 20, 2023 7:25 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply