Page 1 of 1

BCB Code for adding custom axes

Posted: Mon Mar 17, 2008 8:48 pm
by 10045810
I am using TeeChart 8.02 with BCB 6.0. I am looking for example BCB code to allow me to add custom axes to a chart.

Thank you.

Posted: Tue Mar 18, 2008 10:20 am
by narcis
Hi MTW,

You'll find an example here.

labels on a custom axis

Posted: Tue Mar 18, 2008 5:12 pm
by 10045810
Thank you for the code snippet.

I am using the following code:
TChartAxis *TpAxis;
TpAxis = new TChartAxis(Chart1->CustomAxes);
TpAxis->Horizontal = true;
TpAxis->Minimum =0;
TpAxis->Maximum = 90;
Series2->CustomHorizAxis = TpAxis;
TpAxis->PositionPercent = 5;

TpAxis->Items->Add(10,"220");

to add a horizontal axis to the chart. The axis does appear when I run the program. However, the label "220" is not appearing, as it would if I used the bottom axis. What do I need to do to add labels to a custom axis. Also, is there a way to get the label above the axis, instead of below.

Thank you for your assistance.

Posted: Wed Mar 19, 2008 10:02 am
by narcis
Hi MTW,

You may need to set chart margins as custom axes don't set them automatically, for example:

Code: Select all

	Chart1->MarginBottom = 10;
If this doesn't help please send us a simple example project we can run "as-is" to reproduce the problem here.

You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.