Page 1 of 1

How to get Multi Yvals in Multi series in vbscript

Posted: Mon Dec 05, 2005 8:21 am
by 6919081
hi,

Now i add two series in TChart1, and add data for them.i want to get self series1,series2 Yvalues Corresponding to Point(x) When i move mouse.
sb can add codes in my code.or give me some suggestion or other ways.

Code: Select all

<script language="vbscript">
Sub TChart1_OnMouseMove(shift,X,Y)
<!--Move Mouse get the YVal of the closed point -->
 
End
</script>

Posted: Mon Dec 05, 2005 9:48 am
by narcis
Hi Richard,

You can use something like:

Code: Select all

Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
    Dim index As Integer
    
    For i = 0 To TChart1.SeriesCount - 1
        index = TChart1.Series(i).Clicked(X, Y)
        If (index <> -1) Then
            Label1.Caption = "Series" + CStr(i) + ": " + _
                            CStr(TChart1.Series(i).YValues.Value(index))
        End If
    Next
End Sub