add custom horizontal axes

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Herman
Newbie
Newbie
Posts: 56
Joined: Tue Dec 07, 2004 5:00 am

add custom horizontal axes

Post by Herman » Mon Mar 13, 2006 3:56 am

I separate 3 series into 3 custom vertical axes.
The code is:
void __fastcall TForm1::FormCreate(TObject *Sender)
{
// random data
Series1->FillSampleValues(1000);
Series2->FillSampleValues(1000);
Series3->FillSampleValues(1000);

// create the axes...
TChartAxis *Axis = new TChartAxis( Chart1->CustomAxes );

//Vert for series 2
Axis->StartPosition = 30;
Axis->EndPosition = 60;
Axis->Axis->Color = Series2->SeriesColor;
Series2->CustomVertAxis = Axis;

Axis = new TChartAxis( Chart1->CustomAxes );
Axis->StartPosition = 60;
Axis->EndPosition = 100;
Axis->Axis->Color = Series3->SeriesColor;
Series3->CustomVertAxis = Axis;

Series1->GetVertAxis->EndPosition = 30;

Series2->CustomVertAxis = Chart1->CustomAxes->Items[0];
Series3->CustomVertAxis = Chart1->CustomAxes->Items[1];
Chart1->LeftAxis->EndPosition = 30;
}

How to make it so that each series has each own horizontal axes?

Thank you

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 13, 2006 8:44 am

Hi Herman,

It's almost the same as with vertical axes. You just need to set custom axes Horizontal property to true and assign them to the series as custom horizontal axis:

Code: Select all

  Axis->Horizontal:=true;
  Series3->CustomHorizAxis:=Chart1->CustomAxes->Items[0];
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply