scPoint tooltips

TeeChart for ActiveX, COM and ASP
Post Reply
Rossmc
Newbie
Newbie
Posts: 23
Joined: Thu Mar 30, 2006 12:00 am

scPoint tooltips

Post by Rossmc » Thu Jan 11, 2007 10:30 am

I have a base series which is a normal scLine.

To indicate events at certain points in time I add a scPoint series which then plots squares at the relevant point in time on top of the base line.

I have custom tooltips so I use the OnMouseEnterSeries to determine which series the mouse is on then call the correct tooltip.

In this scenario it is difficult to get the OnMouseEnterSeries event fired for the scPoint series. Even when the cursor is visually inside the point (say a square) the control sees it as entering the base line series.

Is there an event, or some way to check if the cursor is inside a point?

Thanks

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

Post by Narcís » Thu Jan 11, 2007 4:55 pm

Hi Rossmc,

Yes, you can do something as in the example below which uses the OnMouseMove event and series Clicked method.

Code: Select all

Private Sub Form_Load()
    TChart1.AddSeries scLine
    TChart1.AddSeries scPoint
    
    For i = 0 To 10
        YVal = Rnd
    
        TChart1.Series(0).Add YVal, "", clTeeColor
        TChart1.Series(1).Add YVal, "", clTeeColor
    Next
End Sub

Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    Index = TChart1.Series(1).Clicked(X, Y)
    
    If (Index <> -1) Then
        TChart1.Header.Text.Clear
        TChart1.Header.Text.Add CStr(Index)
    Else
        TChart1.Header.Text.Clear
        TChart1.Header.Text.Add "No point"
    End If
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