Page 1 of 1

Create labels on peaks with TFastline

Posted: Wed Dec 15, 2004 12:58 pm
by 4207556
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

Posted: Wed Dec 15, 2004 1:03 pm
by Marjan
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;

Posted: Wed Dec 15, 2004 2:02 pm
by 4207556
Thanks! Works fine