Page 1 of 1

point or line series onmouseover event

Posted: Sun Oct 16, 2005 3:22 pm
by 9231397
I can use the seriesclick event successfully to show user information about a point in the series they have clicked. I do this as below by accessing the valueindex property. I'd like to achieve the same functionality with the mouseover event, but cannot see how to do this. Any help much appreciated.

thank
Sean
Delphi 6 with Teechart Pro 7.01 registered user

procedure TForm1.seriesClick(Sender: TChartSeries; ValueIndex: Integer;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Sender.ValueColor[ValueIndex]:=clred;
//do something here works fine
Chart.CancelMouse:=True;
end;


procedure TForm1.SeriesMouseEnter(Sender: TObject);
begin
//how do I get at the point with mouse over without
//having the value index to get at??
end;

Posted: Mon Oct 17, 2005 7:23 am
by narcis
Hi seanmurphy,

You need to do this getting the series index using Clicked method as you can see here:

Code: Select all

procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var Index: Integer;
begin
  Index:=Series1.Clicked(X,Y);

  if Index <> -1 then
  begin
    Series1.ValueColor[Index]:=clRed;
    Chart1.CancelMouse:=true;
  end;
end;

Posted: Mon Oct 17, 2005 8:41 am
by 9231397
thanks Narcis, that's just what I needed.
cheers
Sean