04-09-2010 08:41 AM
I have a GUI that contains a graph control. By making use of the Graph events I have been able to add and delete a data point on my graph by right clicking on the graph control and then handling the event in the vi...no problem. What I'd really like to do now is to allow the user to pick a data point on the graph and drag it to a new position, thus providing an easy way for the user to define a given waveform...I'm stuck!
I'm using LabVIEW 2009.
Solved! Go to Solution.
04-09-2010 08:53 AM
Have you concidered using the cursors to help you out?
Cursors can be dragged so logically (in your code) associating the cursor with a data point you can use the cursor to move the point.
Bonus functionality for cursor is if you show the cursor legend the user can key in the values.
Ben
04-09-2010 08:55 AM - edited 04-09-2010 08:56 AM
You would need to use cursors. You can use one cursor and have it set up to snap to points. You move the point by actually moving the cursor, and responding to cursor move events. See this example: Interactive X-Y Graph Plot Editor.
EDIT: See? Ben had the same idea.
04-09-2010 09:04 AM
Two Knights in Two minutes... Then is MUST be right.
Ben
PS I think there is a shipping example that uses the Picture control to edit signals...was it intended for use with the arbitrarary waveform generator?
04-12-2010 07:35 AM
Thanks for the advice.
I used the cursors originally to add and delete data point from the XY graph, I followed your advice to use the cursor to modify the waveform too. It's all up and running now and runs pretty smoothly. Shame there's no way to directly pickup a data point though from the curve..