Vbscript with Teechart 7

TeeChart for ActiveX, COM and ASP
Post Reply
nthant@infoscan.co.nz
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Vbscript with Teechart 7

Post by nthant@infoscan.co.nz » Tue May 20, 2008 5:45 am

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.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue May 20, 2008 7:55 am

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
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

nthant@infoscan.co.nz
Newbie
Newbie
Posts: 6
Joined: Fri Feb 09, 2007 12:00 am

Post by nthant@infoscan.co.nz » Wed May 21, 2008 2:06 am

Thanks it is all working now.

Post Reply