BCB Code for adding custom axes

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MTW
Newbie
Newbie
Posts: 21
Joined: Thu Jun 28, 2007 12:00 am

BCB Code for adding custom axes

Post by MTW » Mon Mar 17, 2008 8:48 pm

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.

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

Post by Narcís » Tue Mar 18, 2008 10:20 am

Hi MTW,

You'll find an example here.
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

MTW
Newbie
Newbie
Posts: 21
Joined: Thu Jun 28, 2007 12:00 am

labels on a custom axis

Post by MTW » Tue Mar 18, 2008 5:12 pm

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.

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

Post by Narcís » Wed Mar 19, 2008 10:02 am

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