Create labels on peaks with TFastline

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Arnold D
Newbie
Newbie
Posts: 5
Joined: Sun Nov 04, 2001 5:00 am

Create labels on peaks with TFastline

Post by Arnold D » Wed Dec 15, 2004 12:58 pm

Is it possible to draw labels with text on the peaks (I know the coordinates) of a TFastline?

I've tried to use the textvalue while using the AddXY function, but when enabling the labels, I see all labels for all datapoints, so not just the assigned labels.

I'm using V5.03 for D7

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Dec 15, 2004 1:03 pm

Hi, Arnold.

You can use series OnGetMarkText event to filter point labels you want to display. For example:

Code: Select all

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
  ValueIndex: Integer; var MarkText: String);
begin
  if Sender.YValue[ValueIndex] <> Sender.YValues.MaxValue then MarkText := ''
  else MarkText := 'Max';
end;
Marjan Slatinek,
http://www.steema.com

Arnold D
Newbie
Newbie
Posts: 5
Joined: Sun Nov 04, 2001 5:00 am

Post by Arnold D » Wed Dec 15, 2004 2:02 pm

Thanks! Works fine

Post Reply