Page 1 of 1

TChart.AdjustMinMax wrong for inverted axis

Posted: Thu Oct 29, 2015 7:44 am
by 16575285
Hi,

I am using TeeChart Pro 2013.09.131119 32-bit VCL in Delphi XE5.

I create a TChart with an inverted non-automatic left axis. Adding more series and I then need to reset the extents of the non-automatic axis. To get the extents of the data plotted so far I execute these two lines:

TargetAxis.Automatic:=True;
TargetAxis.AdjustMaxMin;

Then, left axis minimum is reported to be -99999, though the minimum data value is zero.

This error occurs only if the axis is inverted.

Is this a bug?

Regards

Toreba

Re: TChart.AdjustMinMax wrong for inverted axis

Posted: Fri Oct 30, 2015 4:45 pm
by yeray
Hello Toreba,

This seems to work fine both with TeeChart v2013.09 and the actual v2015.16:

Code: Select all

uses Series, TeeConst;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Caption:=TeeMsg_Version;

  Chart1.AddSeries(TLineSeries).FillSampleValues(10);
  Chart1.Axes.Bottom.Inverted:=true;

  Chart1.Axes.Bottom.SetMinMax(0, 12);
end;

procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
  with Chart1.AddSeries(TLineSeries) do
  begin
    Add(50+random*100);
    for i:=1 to 20-1 do
      Add(YValue[i-1]+random*10+5);
  end;

  Chart1.Axes.Bottom.Automatic:=true;
end;
I may be missing some relevant setting to reproduce the problem.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?

Thanks in advance.