Automatic Axis Increment

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Lykke
Newbie
Newbie
Posts: 3
Joined: Tue Jan 31, 2017 12:00 am

Automatic Axis Increment

Post by Lykke » Fri Feb 03, 2023 10:33 am

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?
Attachments
TeeChartAxisIncrement.png
TeeChartAxisIncrement.png (15.4 KiB) Viewed 5542 times

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

Re: Automatic Axis Increment

Post by Yeray » Fri Feb 03, 2023 4:05 pm

Hello,

I'm afraid the algorithm for the automatic axis increment has limitations and it's difficult to handle all the possibilities.
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

Lykke
Newbie
Newbie
Posts: 3
Joined: Tue Jan 31, 2017 12:00 am

Re: Automatic Axis Increment

Post by Lykke » Tue Feb 07, 2023 10:16 am

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.

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

Re: Automatic Axis Increment

Post by Yeray » Mon Feb 20, 2023 12:29 pm

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
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

Lykke
Newbie
Newbie
Posts: 3
Joined: Tue Jan 31, 2017 12:00 am

Re: Automatic Axis Increment

Post by Lykke » Wed Feb 22, 2023 12:03 pm

I have done the change and confirm that it is working. Thanks a lot for your support!

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

Re: Automatic Axis Increment

Post by Yeray » Thu Feb 23, 2023 10:49 am

Hello,

Great. Thanks for the feedback!
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