TChart.AdjustMinMax wrong for inverted axis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Toreba
Newbie
Newbie
Posts: 29
Joined: Wed Sep 02, 2015 12:00 am

TChart.AdjustMinMax wrong for inverted axis

Post by Toreba » Thu Oct 29, 2015 7:44 am

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

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

Re: TChart.AdjustMinMax wrong for inverted axis

Post by Yeray » Fri Oct 30, 2015 4:45 pm

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