03-20-2009 03:24 PM
how to add (multiple) cursors programmatically in an XY graph?
I am building an XY graph. then I would like to add cursors at certain locations (positioned on x axis) I determine through a program.
How can I add cursors programatically?
Thank you.
03-20-2009 03:37 PM
Check out this thread:
http://forums.ni.com/ni/board/message?board.id=170&message.id=245120&query.id=17462#M245120
03-20-2009 03:42 PM
Thank you, but the thread is not good enough. The answer provided by Evan is closest to what I have but not good enough.
I have no cursors on the graph before I start the program. The program draws an XY graph and then determines certain locations on X axis where I want to input cursors. The number of cursors is different every time. How could I add or create cursors on the XY graph starting with no cursors in the beginning? Then, how can I clear the cursors if I need to?
03-20-2009 04:03 PM - edited 03-20-2009 04:04 PM
Initialize a cluster array (CrsrList type) with as many cursors as you think you would ever need. Setup your cursors dynamically, then delete the unused cursors (array elements) and then update your CursorList property.
03-20-2009 04:15 PM
I think I'm on the right path but I still can show only one cursor. Could you be more specific?
03-20-2009 04:42 PM
The graph has a property called CSRLIST, which you can set.
It's an array of CURSOR clusters.
Build each one the way you need it (Position.X, Position.Y, Color, etc.).
Build them into an array.
Assign the array to the CSRLIST property.
Enjoy!
Blog for (mostly LabVIEW) programmers: Tips And Tricks