I need to get the y-values (the intensity) of several color grid series within my chart. Given values are Mouse x-coordinate and fix Z index.
First I thought getxzvalues might by the right method, but that doesn't work

Kind regards,
Jan
Code: Select all
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Dim ValueIndex As Integer
For i = 0 To TChart1.SeriesCount - 1
ValueIndex = TChart1.Series(i).Clicked(X, Y)
If ValueIndex <> -1 Then
List1.AddItem CStr(TChart1.Series(i).YValues.Value(ValueIndex))
End If
Next
End Sub
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
![]() ![]() ![]() ![]() ![]() ![]() |
Instructions - How to post in this forum |
Code: Select all
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Dim ValueIndex As Integer
List1.Clear
For i = 0 To TChart1.SeriesCount - 1
ValueIndex = TChart1.Series(i).Clicked(X, Y)
If ValueIndex <> -1 Then
List1.AddItem "X: " & CStr(TChart1.Series(i).XValues.Value(ValueIndex))
List1.AddItem "Y: " & CStr(TChart1.Series(i).YValues.Value(ValueIndex))
List1.AddItem "Z: " & CStr(TChart1.Series(i).asColorGrid.ZValues.Value(ValueIndex))
End If
Next
End Sub
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
![]() ![]() ![]() ![]() ![]() ![]() |
Instructions - How to post in this forum |
Code: Select all
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Dim ValueIndex, XVal As Integer
Dim HorizAxis As TeeChart.IAxis
List1.Clear
For i = 0 To TChart1.SeriesCount - 1
Select Case TChart1.Series(i).HorizontalAxis
Case 0 'aTopAxis = 0
Set HorizAxis = TChart1.Axis.Top
Case 1, 2 'aBottomAxis = 1, aBothHorizAxis = 2
Set HorizAxis = TChart1.Axis.Bottom
Case 3 'aCustomHorizAxis = 3
Set HorizAxis = TChart1.Axis.Custom(TChart1.Series(i).HorizontalAxisCustom)
End Select
XVal = HorizAxis.CalcPosPoint(X)
ValueIndex = TChart1.Series(i).XValues.Locate(XVal)
If ValueIndex <> -1 Then
List1.AddItem "X: " & CStr(TChart1.Series(i).XValues.Value(ValueIndex))
List1.AddItem "Y: " & CStr(TChart1.Series(i).YValues.Value(ValueIndex))
List1.AddItem "Z: " & CStr(TChart1.Series(i).asColorGrid.ZValues.Value(ValueIndex))
End If
Next
End Sub
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
![]() ![]() ![]() ![]() ![]() ![]() |
Instructions - How to post in this forum |