Page 1 of 1

Automatic Axis Increment

Posted: Fri Feb 03, 2023 10:33 am
by 16480001
Dear Support Team

We have an issue with the axis automatic increment being not well selected. Steps to reproduce are the following:

1. Add a TChart to a form
2. Add a TPointSeries to the Chart
3. Add the following code:
Chart1.LeftAxis.SetMinMax(-0.855,0.855);
Chart1.BottomAxis.SetMinMax(-0.855,0.855);
Series1.AddXY(-0.475,0.151);
Series1.AddXY(0.475,0.151);

This result in bottom axis having just one label (at zero) as shown in attached screendump. Why is the automatic axis increment not working well in this case?

Re: Automatic Axis Increment

Posted: Fri Feb 03, 2023 4:05 pm
by yeray
Hello,

I'm afraid the algorithm for the automatic axis increment has limitations and it's difficult to handle all the possibilities.

Re: Automatic Axis Increment

Posted: Tue Feb 07, 2023 10:16 am
by 16480001
I understand it is difficult to handle all situations, but it is a very simple case that I think it should handle.

The example can be even simpler as there is no need to add the points. Just these lines give exactly the same behavior:

Chart1.LeftAxis.SetMinMax(-0.855,0.855);
Chart1.BottomAxis.SetMinMax(-0.855,0.855);

In the example the axis limits are the same on both axes and no points are added. The left axis increment is well selected, but not on the bottom axis which lead to exactly the same as uploaded earlier. I think automatic axis increments should cover such simple example.

Re: Automatic Axis Increment

Posted: Mon Feb 20, 2023 12:29 pm
by yeray
Hello,

We've discussed about it and ended adding a fix for this (#2589).
Since you own the sources, you can apply it and recompile.

Search for this line in TeEngine.pas:

Code: Select all

        if tmp.Active and IsAssociated(tmp) then
Modify it for this:

Code: Select all

        if tmp.Active and IsAssociated(tmp) and
           HasLabels(tmp) and not HasNoMandatoryValues(tmp) then

Re: Automatic Axis Increment

Posted: Wed Feb 22, 2023 12:03 pm
by 16480001
I have done the change and confirm that it is working. Thanks a lot for your support!

Re: Automatic Axis Increment

Posted: Thu Feb 23, 2023 10:49 am
by yeray
Hello,

Great. Thanks for the feedback!