logarithmic axis are scaled wrong in release 2022.36

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
WilliE
Newbie
Newbie
Posts: 18
Joined: Mon Nov 30, 2020 12:00 am

logarithmic axis are scaled wrong in release 2022.36

Post by WilliE » Fri Oct 21, 2022 11:39 am

Hello,
we just upgraded to ver. 2022.36. We have a problem if the axis is scaled in logarithmic and auto mode. It looks like the axis is not scaled to the max value of the graph but to the next higher full decimal number (eg. 1000 or 10000 or 100000 ...)
In 2022.36 all was ok.

We use Delphi 11.1

Willi

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

Re: logarithmic axis are scaled wrong in release 2022.36

Post by Yeray » Mon Oct 24, 2022 9:19 am

Hello,
WilliE wrote:
Fri Oct 21, 2022 11:39 am
In 2022.36 all was ok.
Sorry, I guess you meant an older version. Could you please correct it so we can compare the changes?
Thanks!
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

axrvgareth
Newbie
Newbie
Posts: 1
Joined: Wed Feb 20, 2019 12:00 am

Re: logarithmic axis are scaled wrong in release 2022.36

Post by axrvgareth » Mon Oct 24, 2022 4:46 pm

I have seen this as well, logarithmic scaling has changed from 2022.35 to 2022.36. See the attached images.
Attachments
Plot 2022_36.png
Version 2022.36
Plot 2022_36.png (36.75 KiB) Viewed 10147 times
Plot 2022_35.png
Version 2022.35
Plot 2022_35.png (44.79 KiB) Viewed 10147 times

WilliE
Newbie
Newbie
Posts: 18
Joined: Mon Nov 30, 2020 12:00 am

Re: logarithmic axis are scaled wrong in release 2022.36

Post by WilliE » Mon Oct 24, 2022 5:02 pm

Hello
In 2022.35 all was ok :)

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

Re: logarithmic axis are scaled wrong in release 2022.36

Post by Yeray » Wed Oct 26, 2022 9:24 am

Hello Willi,

I could reproduce the problem so I've added it to the public tracker (#2564) and also fixed it for the next release.
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

WilliE
Newbie
Newbie
Posts: 18
Joined: Mon Nov 30, 2020 12:00 am

Re: logarithmic axis are scaled wrong in release 2022.36

Post by WilliE » Wed Oct 26, 2022 11:50 am

Hello Yeray,
thank you very much. But is there a workaround because logarithmic scaling is very important for us?

Willi

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

Re: logarithmic axis are scaled wrong in release 2022.36

Post by Yeray » Wed Oct 26, 2022 2:28 pm

Hello Willi,

If you own the sources, you can open the TeEngine.pas unit and substitute the TChartAxis.LogYPosValue function for this:

Code: Select all

Function TChartAxis.LogYPosValue(Const Value:TChartValue):Integer;
begin
  if IRangeLog=0 then result:=ICenterPos
  else
  begin
    if Value<=0 then
       if not FInverted then result:=IEndPos
                        else result:=IStartPos
    else
    begin
      if IRadiusAxis then
      Begin
        if FInverted then result:=Round((ILogMax-ln(Value))*(IAxisLogSizeRange/2))
                     else result:=Round((ln(Value)-ILogMin)*(IAxisLogSizeRange/2));

        result:=ICenterPos-result;
      end
      else
      Begin
        if FInverted then result:=Round((ILogMax-ln(Value))*(IAxisLogSizeRange))
                     else result:=Round((ln(Value)-ILogMin)*(IAxisLogSizeRange));

        result:=IEndPos-result;
      end;
    end;
  end;
end;
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

WilliE
Newbie
Newbie
Posts: 18
Joined: Mon Nov 30, 2020 12:00 am

Re: logarithmic axis are scaled wrong in release 2022.36

Post by WilliE » Thu Oct 27, 2022 4:22 pm

Perfect :)

Post Reply