Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Position cursor at the X-Axis center

Hi,

I am reading X-Y data from a file and I would like to position the cursor at the center of X-axis limits.
So irrespective of the data size,the cursor will be always visible to the user.

Any help is highly appreciated.

Thanks in advance
Joshi P.S.
0 Kudos
Message 1 of 2
(3,217 Views)
I think what you'll need to do is write a function that repositions the cursor based on the current X axis range and then call that function after you plot or chart data. For example:

Private Sub AdjustCursor(axis As CWAxis, cursor As CWCursor)
Debug.Assert Not axis Is Nothing
Debug.Assert Not cursor Is Nothing
cursor.XPosition = axis.Minimum + (axis.Maximum - axis.Minimum) / 2
End Sub

Now if you dropped a graph on the form and it had one X axis, one Y axis, and one cursor, you could call it like this:

CWGraph1.ChartY data
AdjustCursor CWGraph1.Axes(1), CWGraph1.Cursors(1)

- Elton
0 Kudos
Message 2 of 2
(3,217 Views)