Page 1 of 1

logarithmic axis are scaled wrong in release 2022.36

Posted: Fri Oct 21, 2022 11:39 am
by 16590099
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

Re: logarithmic axis are scaled wrong in release 2022.36

Posted: Mon Oct 24, 2022 9:19 am
by yeray
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!

Re: logarithmic axis are scaled wrong in release 2022.36

Posted: Mon Oct 24, 2022 4:46 pm
by 16585703
I have seen this as well, logarithmic scaling has changed from 2022.35 to 2022.36. See the attached images.

Re: logarithmic axis are scaled wrong in release 2022.36

Posted: Mon Oct 24, 2022 5:02 pm
by 16590099
Hello
In 2022.35 all was ok :)

Re: logarithmic axis are scaled wrong in release 2022.36

Posted: Wed Oct 26, 2022 9:24 am
by yeray
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.

Re: logarithmic axis are scaled wrong in release 2022.36

Posted: Wed Oct 26, 2022 11:50 am
by 16590099
Hello Yeray,
thank you very much. But is there a workaround because logarithmic scaling is very important for us?

Willi

Re: logarithmic axis are scaled wrong in release 2022.36

Posted: Wed Oct 26, 2022 2:28 pm
by yeray
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;

Re: logarithmic axis are scaled wrong in release 2022.36

Posted: Thu Oct 27, 2022 4:22 pm
by 16590099
Perfect :)