TChartSeries.OnGetMarkText and TMarksTipTool.OnGetText

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
fabnav
Newbie
Newbie
Posts: 17
Joined: Thu Sep 30, 2004 4:00 am

TChartSeries.OnGetMarkText and TMarksTipTool.OnGetText

Post by fabnav » Wed May 09, 2007 5:20 pm

Hi,

I want to have different mark text displayed when the mark is initiated by the TMarkTipTool, or when it is initiated as the chart is drawn by the normal TChartSeries.OnGetMarkText.

I can't figure out how to do this because it seems that the TMarkToolTip is getting the mark text by calling TChartSeries.OnGetMarkText. I think I need something passed to TChartSeries.OnGetMarkText that tells me who is requesting the mark text.

Regards,

Bill

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

Post by Narcís » Thu May 10, 2007 10:22 am

Hi Bill,

You can use both events as shown here:

Code: Select all

var
  Form1: TForm1;
  Series: TChartSeries;
  Index: Integer;

implementation

{$R *.dfm}

procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
  ValueIndex: Integer; var MarkText: String);
begin
  MarkText := 'Point ' + IntToStr(ValueIndex+1);
  Series:=Sender;
  Index:=ValueIndex;
end;

procedure TForm1.ChartTool1GetText(Sender: TMarksTipTool;
  var Text: String);
begin
  Text := FloatToStr(Series.YValue[Index]);
end;
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

fabnav
Newbie
Newbie
Posts: 17
Joined: Thu Sep 30, 2004 4:00 am

Post by fabnav » Thu May 10, 2007 10:45 am

Thank you. That works.

Bill

Post Reply