Get Index of Cursor at unknown X or Y Value?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
tbonejo
Newbie
Newbie
Posts: 73
Joined: Wed Sep 06, 2006 12:00 am
Contact:

Get Index of Cursor at unknown X or Y Value?

Post by tbonejo » Fri Feb 02, 2007 3:59 pm

I need to get the index of the position of a cursor at an unknown x or y value. I can get the rest and I seen a GetCursorValueIndex function with the Series Heirarchy and tried it but it didnt return what I needed.

Any ideas?


Thanks,

Tom
Tom

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

Post by Narcís » Fri Feb 02, 2007 4:26 pm

Hi Tom,

What about doing something as I suggested here in TCursorTool's OnChange event? OnChange's ValueIndex parameter only has valid values when the cursor is set to snap.
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

tbonejo
Newbie
Newbie
Posts: 73
Joined: Wed Sep 06, 2006 12:00 am
Contact:

Post by tbonejo » Fri Feb 02, 2007 4:33 pm

narcis wrote:Hi Tom,

What about doing something as I suggested here in TCursorTool's OnChange event? OnChange's ValueIndex parameter only has valid values when the cursor is set to snap.
Yeah I used this code below for the on change event in the cursor:

Code: Select all

curpos: Integer;
curpos := Chart1.Series[seriesidx].XValues.Locate(XValue);
That works good so far. I just have to reset it to 0 if they go past the lastindex point.

Thanks,

Tom
Tom

Post Reply