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.
已解决! 转到解答。
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
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.
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?
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..