From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to move a point of a plot on XY graph?

See picture and attached VI.

How to use mouse to move a point of the plot to modify the plot data?

I have tried in many ways but failed.Appreciated if any code provided.

2017-01-16_231652.png

0 Kudos
Message 1 of 3
(3,559 Views)

Your initial attempt doesn't show very much and I don't think this is going to be as easy as you might hope.

I would suggest using an event structure to trap the mouse down event on your XY Graph and use the Coordinate map to figure out which point you are closest to. From there, I think you can then trap the mouse up event to overwrite that index in your XY Graph and replot.

 

0 Kudos
Message 2 of 3
(3,519 Views)

Look up Cursors in the LabVIEW Help.  You can create a cursor that "Snaps to" each of the points on your plot, and returns the X and Y values.  With these data, you will be in a much better position to write a VI that lets you use a "Mouse-down" operation to modify the selected point in the graph.  Note you may want to consider whether you want to move only vertically (X remains constant), only horizontally (Y constant), or freely (both X and Y change).  You'll need to redraw the graph to show the change.  Alternatively, you can put the cursor on the point you want to change, click where you want the point to go, interpret the Mouse Position when clicked as the new X, Y, then modify the Cursor's selected point's X and Y appropriately.

 

Bob Schor

0 Kudos
Message 3 of 3
(3,497 Views)