11-16-2005 02:58 PM
11-17-2005 03:03 PM
11-17-2005 03:19 PM
11-17-2005 03:52 PM
I spoke too soon. Sure the cursors can be positioned using code such as
CWGraph1.Cursors(1).XPosition = 1000
CWGraph1.Cursors(1).YPosition = 1000
However this does not come close to what I asked. I will try again
3 plots, 3 cursors, Graph is Stripchart. Chart History 10000
plot 10000 points on each plot.
cursors by default will be in the lower left corner of the graph.
I use this to show my Y value
Private Sub CWGraph1_CursorChange(CursorIndex As Long, XPos As Variant, YPos As Variant, bTracking As Boolean)
CWGraph1.Annotations(CursorIndex).Caption.XCoordinate = XPos + 200 'XIncrement
CWGraph1.Annotations(CursorIndex).Caption.YCoordinate = YPos + 20
CWGraph1.Annotations(CursorIndex).Caption.Text = YPos
End Sub
NOW, set CWGraph1.TrackMode = cwGTrackPanPlotAreaX, pan ahead with your mouse.
NOW, CWGraph1.TrackMode = cwGTrackDragCursor
Where are the Cursors? They are invisible because they panned out of view when you just panned the graph.
I need to know how to get the Cursors back to the lower left corner of the Graph where they started.
The sample I started with is CwGraph_with_Annotated_Cursors.zip
We are about to purchase your latest version of Measurement Studio but at this point I think it would be a waste of money!
Thank you,
11-17-2005 06:16 PM
Bob,
Here is a code snippet that returns the one cursor to the bottom left of the screen, and the other to the middle (I used this code after all panning and zooming was completed, and I wanted to go back to cwTrackDragCursor):
CWGraph1.TrackMode = cwGTrackDragCursor
CWGraph1.Cursors(1).XPosition = (CWGraph1.Axes(1).Minimum)
CWGraph1.Cursors(1).YPosition = (CWGraph1.Axes(2).Minimum)
CWGraph1.Cursors(2).XPosition = (CWGraph1.Axes(1).Minimum + CWGraph1.Axes(1).Maximum) / 2
CWGraph1.Cursors(2).YPosition = (CWGraph1.Axes(2).Minimum + CWGraph1.Axes(2).Maximum) / 2
I will need to look into using cursors for doing pan/zooming. I'll get back to you on that one.
Have a good day!
Andrew W
National Insruments
11-17-2005 08:00 PM