Page 1 of 1

add custom horizontal axes

Posted: Mon Mar 13, 2006 3:56 am
by 9235196
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

Posted: Mon Mar 13, 2006 8:44 am
by narcis
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];