Page 1 of 1

Vbscript with Teechart 7

Posted: Tue May 20, 2008 5:45 am
by 9534191
sub TChart1_OnCursorToolChange(Tool, X, Y, XVal, YVal, Series, ValueIndex)
If Tool = 0 Then
TChart1.Tools.Items(1).asTeeCursor.XVal = TChart1.Tools.Items(0).asTeeCursor.XVal
Else
TChart1.Tools.Items(0).asTeeCursor.XVal = TChart1.Tools.Items(1).asTeeCursor.XVal
End If
End Sub

The above oncursortoolchange procedure does not get call. Is there anything wrong with the code.

I have 2 series on the chart with custom axis. I need the teecursor tool to extent it to both series. currently, cursor tool is either in series on axis or in series 2 exits.

The forum suggest to place 2 cursor tool on the chart and use oncursortoolchange event but it does not work.

Posted: Tue May 20, 2008 7:55 am
by yeray
Hi nthan,

Which TeeChart version are you exactly using? Please, ensure that you are running the newest AX version available at the web (v7.0.1.4).

This code works fine for me here with this version:

Code: Select all

Private Sub TChart1_OnCursorToolChange(ByVal Tool As Long, ByVal X As Long, ByVal Y As Long, ByVal XVal As Double, ByVal YVal As Double, ByVal Series As Long, ByVal ValueIndex As Long)
  If Tool = 0 Then
    TChart1.Tools.Items(1).asTeeCursor.XVal = TChart1.Tools.Items(0).asTeeCursor.XVal
  Else
    TChart1.Tools.Items(0).asTeeCursor.XVal = TChart1.Tools.Items(1).asTeeCursor.XVal
  End If
End Sub

Posted: Wed May 21, 2008 2:06 am
by 9534191
Thanks it is all working now.