Different axis labels for Top and Bottom when aBothHorizAxis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
SteveP
Advanced
Posts: 132
Joined: Sun Sep 07, 2003 4:00 am

Different axis labels for Top and Bottom when aBothHorizAxis

Post by SteveP » Thu Jul 13, 2006 6:00 pm

When a series is configured to use both horizontal axis, it is possible to assign a different axis label for the top and for the bottom axis ? I would prefer to do this in the series1.AddXY method rather than OnGetAxisLabel event. OnGetAxisLabel fires for axis labels other than those data values actually added to the series. It fires for example for labels that are going to be shown in-between the data values supplied with AddXY. Such labels must be detected and not shown. When the label is supplied in the AddXY method, no in-between data value labels appear on the chart.

Steve

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

Post by Narcís » Fri Jul 14, 2006 7:23 am

Hi Steve,

To achieve what you request you should use custom labels as shown in the All Features\Welcome!\Axes\Labels\Custom Labels example at in TeeChart's features demo.
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

SteveP
Advanced
Posts: 132
Joined: Sun Sep 07, 2003 4:00 am

Post by SteveP » Tue Jul 18, 2006 4:18 pm

Narcis,

For my application, custom labels has an issue in that their label separation is not automatically recalculated to remove overlap if the chart or its form is resized.

I am also using chart1.Assign to copy one chart to another invisible chart so that I may change some of the copied chart's properties (colors) before it is printed. I do not recall if such custom labels persist into such a copied chart, but that may be another issue for my application.

Steve

Pep
Site Admin
Site Admin
Posts: 3198
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jul 24, 2006 9:01 am

Hi,
When a series is configured to use both horizontal axis, it is possible to assign a different axis label for the top and for the bottom axis ? I
You could use the AddXY method, but will use the same label for top and bottom axes. If you want to have different labels will have to use the OnGetAxisLabel event, or a trick, which is to use a fake Series, assigning the top axis to this one, add the same data as for the other Series and make it invisible setting clNone as color and setting false to ShowInLegend property.

Post Reply