Getting point indexes

TeeChart for ActiveX, COM and ASP
Post Reply
SAJ
Newbie
Newbie
Posts: 8
Joined: Fri Nov 15, 2002 12:00 am
Contact:

Getting point indexes

Post by SAJ » Tue Jun 07, 2005 8:52 am

Hi!
I'd like to obtain the point indexes for the visible points in my chart.
The bottom axis is date-time and the left axis has doubles.
I've tried cht.Series(0).XValues.Locate(cht.Axis.bottom.Minimum) but it seems like there is no point at that exact value and so it returns -1 :(

TIA
/Kejpa

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

Post by Narcís » Tue Jun 07, 2005 9:29 am

Hi Kejpa,

You can get those indexes and its value doing something like:

Code: Select all

Private Sub TChart1_OnAfterDraw()
    For j = TChart1.Series(0).FirstValueIndex To TChart1.Series(0).LastValueIndex - 1
        Label1.Caption = Label1.Caption + "Index: " + CStr(j) + ", " + CStr(TChart1.Series(0).XValues.Value(j))
    Next j
End Sub
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

Post Reply