Index

From: David Berneda  Steema Software
Subject: Re: MarksTipTool.GetText inform about the used series...
Date: Mon, 15 Apr 2002 11:26:02 +0200
Newsgroup: public.teechart5.wishes  

Hi Alex
You can use the code below.
We'll add this wish at our wish-database.
regards
david

Function FindClickedSeries(Chart:TCustomChart):TChartSeries;
var t,x,y : Integer;
begin
result:=nil;
x:=Chart.GetCursorPos.x;
y:=Chart.GetCursorPos.y;
for t:=0 to Chart.SeriesCount-1 do
if Chart[t].Clicked(x,y)<>-1 then
begin
result:=Chart[t];
break;
end;
end;

// EXAMPLE OF USE:

procedure TForm1.ChartTool1GetText(Sender: TMarksTipTool;
var Text: String);
var Series : TChartSeries;
begin
Series:=FindClickedSeries(Chart1);
if Assigned(Series) then Caption:=Series.Name+' '+Text;
end;



"Alex" wrote in message news:XTWb$4T4BHA.1276@teepc...
> Hi together,
>
> a great wish is that I get information about the used series in the
> OnGetText-Event from TMarksTipTool. The background is that I just will
> display a hint with the name of the series the cursor is on. The property
> TMarksTipTool.Series is nil because I will do this for all series that are
> displayed.
>
> Alex
>
>