v2023.39 (231109) y-axis label issue

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

v2023.39 (231109) y-axis label issue

Post by bdw » Wed Mar 20, 2024 11:03 pm

Hi,
I've just upgraded from 2021.32.210430 to v2023.39 (231109) which seems to have a y-axis drawing difference.
As the image shows attached the left graph has for example 60.48 on the y-axis while on the previous version this would be 64, 56, 48 etc. Axis min = 0 and max = 65. It draws correctly with more space but if window is small its adding the dp's.
The AxisValueFormat is still the default graph_->LeftAxis->AxisValuesFormat = "###0.###";
I can reduce set ###0 which restricts it but wondering why the values produced are so different ?
Is this an issue with the new VCL TChart ?
Attachments
tchartCapture.JPG
tchartCapture.JPG (20.79 KiB) Viewed 490 times

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

Re: v2023.39 (231109) y-axis label issue

Post by Yeray » Fri Mar 22, 2024 3:40 pm

Hello,

I've tried to reproduce the problem with this simple example code without success.

Code: Select all

uses Chart, Series;

var Chart1: TChart;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1:=TChart.Create(Self);

  with Chart1 do
  begin
    Parent:=Self;
    Align:=alClient;
    Color:=clWhite;
    Gradient.Visible:=False;
    Walls.Back.Color:=clWhite;
    Walls.Back.Gradient.Visible:=False;
    Legend.Hide;
    View3D:=False;

    with AddSeries(TLineSeries) do
      for i:=0 to 19 do
        Add(Random*65);

    Axes.Left.SetMinMax(0, 65);
    Axes.Left.Title.Text:='Left axis';
  end;
end;
Do you have a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
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

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: v2023.39 (231109) y-axis label issue

Post by bdw » Fri Mar 22, 2024 9:28 pm

Thanks Yeray.
I'll have to dig into the code some more to see what is causing the difference and get back to you.
I was assuming exactly the same code base on our side but will dig some more.

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: v2023.39 (231109) y-axis label issue

Post by bdw » Tue Mar 26, 2024 9:09 pm

Only just had a chance to re-look at what the code we have is doing.
We also have the Axis.Left.Increment := 1 set in this case to try and reduce the number of y-axis labels rather than automatic.
With that setting in the past it still kept the y-axis labels clean rather than having the in the example 64.8, 57.6 etc
I've not tested that code on the older release yet but will try shortly
Attachments
GraphCapture.JPG
GraphCapture.JPG (31.23 KiB) Viewed 354 times

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: v2023.39 (231109) y-axis label issue

Post by bdw » Tue Mar 26, 2024 11:03 pm

Ok I've tested with the two TChart version listed previously and as you can see with the same code the graphs look quite different.
Top one is v2021.x and bottom v2023.x
Attachments
GraphCapture.JPG
GraphCapture.JPG (45.28 KiB) Viewed 348 times

bdw
Advanced
Posts: 130
Joined: Mon Mar 07, 2005 5:00 am
Location: New Zealand
Contact:

Re: v2023.39 (231109) y-axis label issue

Post by bdw » Wed Mar 27, 2024 3:29 am

Ok I have a work around for the present time.
I check the ClientHeight and when its less than 200pixel I set Increment=0 (which is automatic by my testing) for graphs with max - min height < 200 units.
Greater than 200 height units I just set Increment=0

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

Re: v2023.39 (231109) y-axis label issue

Post by Yeray » Wed Mar 27, 2024 9:55 am

Hello,

Indeed setting Increment to 1 was the key to reproduce the problem.
I've added it to the public tracker: #2690
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