TChartShape and automatic scale

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Ael
Newbie
Newbie
Posts: 4
Joined: Fri Apr 30, 2010 12:00 am

TChartShape and automatic scale

Post by Ael » Tue Jun 29, 2010 7:36 am

Hello,

I have a TChart composed of a few TLineSeries and using automatic scaling. I added a TChartShape serie, set X0-1/Y0-1 to the correct values but the bottom axis range is now 0-3000 instead of 2600-3000 before I added the TChartShape.

Am I missing something ? Do I need to force the scale ?

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

Re: TChartShape and automatic scale

Post by Yeray » Wed Jun 30, 2010 9:43 am

Hi Ael,

Note that the axes will be auto scaled to show both the shape series and the line series completely.
The following code seems to work fine here:

Code: Select all

uses Series, TeeShape;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.View3D:=false;
  Chart1.AddSeries(TLineSeries);

  Chart1[0].AddXY(2600,random*100);
  for i:=1 to 400 do
    Chart1[0].AddXY(2600+i,Chart1[0].YValue[i-1] + random*10 - 5);

  with Chart1.AddSeries(TChartShape) as TChartShape do
  begin
    X0:=Chart1[0].XValues.MinValue;
    X1:=Chart1[0].XValues.MaxValue;
    Y0:=Chart1[0].YValues.MinValue;
    Y1:=Chart1[0].YValues.MaxValue;
    Transparency:=50;
  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

Post Reply