Unable to keep vertical asTeeCursor object stationary
Posted: Wed Apr 12, 2006 8:32 pm
I am using TeeChart ActiveX (version 7.0.0.4) in an HTML page and am using the asTeeCursor object to provide some vertical cursors. I am able to add then number of vertical cursors as well a move them thru drag/drop of the cursor object. I am using a basic trend with X-Y axis, where X is the time axis and Y is the value axis. Everything behaves as expected until the the data is updated. Since this is a time based trace, when the update occurs, the time axis is shifted as appropriate, and the trace redrawn with the new data. What I would like to be able to provide is a static vertical cursor; however, the behavior that I see is that the vertical cursor is automatically adjusted when the time axis is shifted. Is there anyway to create a static vertical cursor such that when the time axis is shifted, the vertical cursor remains in the same screen postion?
Here is the code that I am using to create the cursor as well as peform the manual positioning.
Thanks,
Scott
Here is the code that I am using to create the cursor as well as peform the manual positioning.
Code: Select all
'/// add additional cursor objects (in Window_OnLoad)
For i = 0 To g_numCursors
TChart1.Tools.Add tcCursor
With TChart1.Tools.Items(TChart1.Tools.Count - 1).asTeeCursor
.FollowMouse = False
.Style = g_cssVertical
.Pen.Color = vbRED
.Pen.Style = g_psClear
.Pen.Width = g_CursorWidth
'.Series = 0
End With
Next
'/// position cursor (in TChart1_OnMouseDown)
If Shift = g_ssShift Then
For i = 1 To g_numCursors'TChart1.Tools.Count'g_numCursors
With TChart1.Tools.Items(i).asTeeCursor
If .Pen.Style = g_psClear Then
.Series = 0
.FollowMouse = False
.Style = g_cssVertical
.Pen.Color = vbRED
.Pen.Style = g_psDash
.Pen.Width = g_CursorWidth
.XVal = TChart1.Series(0).XScreenToValue(X)
cursorArrayXPos(i) = X
Exit For
End If
End With
Next
Scott