point or line series onmouseover event

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
seanmurphy
Newbie
Newbie
Posts: 48
Joined: Fri Mar 12, 2004 5:00 am

point or line series onmouseover event

Post by seanmurphy » Sun Oct 16, 2005 3:22 pm

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;

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

Post by Narcís » Mon Oct 17, 2005 7:23 am

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;
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

seanmurphy
Newbie
Newbie
Posts: 48
Joined: Fri Mar 12, 2004 5:00 am

Post by seanmurphy » Mon Oct 17, 2005 8:41 am

thanks Narcis, that's just what I needed.
cheers
Sean

Post Reply