Making point labels different from x-axis labels

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
BeanTreeze
Newbie
Newbie
Posts: 2
Joined: Thu Jan 03, 2008 12:00 am

Making point labels different from x-axis labels

Post by BeanTreeze » Wed Dec 01, 2010 11:08 pm

Hello -

I'm charting recovery fractions for analyzed samples over time; data is contained in a data table. The X-values point to the Date-Time field, the Y-values are the recovery fractions. Each data point, though, also has a unique Sample Number that I'd like to access and possibly display at the point on the chart. I particularly need access to that Sample number in order to "discard" anomalous recovery fractions. In other words, I'd like the user to be able to simply click on the point and the OnClick event takes over, looks up the point's Sample Number in the associated table, sets the Discarded field to true, and changes the look of the point. I've got all of it figured out except how to access that Sample Number.

When I set the LabelSource to that Sample number field, the labels on the x-axis change to that. I really want to keep the date-time labels there.

Any suggestions? TIA

Teri

P.S. I use Delphi 2009 with TeeChart Pro 8.06.

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

Re: Making point labels different from x-axis labels

Post by Narcís » Tue Dec 07, 2010 11:34 am

Hi Teri,
I've got all of it figured out except how to access that Sample Number.
Are you adding Sample Number as point labels in the series? If so you could get them like this:

Code: Select all

  SampleNumber:=Series1.Labels[ValueIndex];
When I set the LabelSource to that Sample number field, the labels on the x-axis change to that. I really want to keep the date-time labels there.
You just need to set bottom axis LabelStyle to display values instead of labels:

Code: Select all

  Chart1.Axes.Bottom.LabelStyle:=talValue;
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

BeanTreeze
Newbie
Newbie
Posts: 2
Joined: Thu Jan 03, 2008 12:00 am

Re: Making point labels different from x-axis labels

Post by BeanTreeze » Tue Dec 07, 2010 4:17 pm

Thank you! I had figured a workaround using the top axis and putting in a dummy series for the bottom axis, but this works much better and requires much less maintenance. Thanks so much!

Teri

Post Reply