LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY graph lasso data points

Solved!
Go to solution

Hi. I'm looking for a way to plot multiple XY cursors, then use a lasso tool (like paint or photoshop) to select a subset of the cursors.

 

The lasso would allow the user to outline/draw a region with the mouse to select the cursors inside the lassoed area.

 

Can Labview graphs do this natively? Or, is anyone aware of an elegant solution to accomplish this?

0 Kudos
Message 1 of 5
(2,472 Views)
Solution
Accepted by topic author Marksyn

Hi Marksyn,

 

No, that behavior is not native in LabVIEW.

 

First off, can the selection be rectangular, or does it have to be a 'freeform' shape? The latter will be much more difficult to write, but it would look something like this.

 

Build an event structure and make event cases for Mouse Down/Mouse Up (to keep track of when the button is pressed), and Mouse Move for the XY graph. In the Mouse Move case, LabVIEW will return the panel coordinates of the mouse each time it moves. To get XY coordinates, use an invoke node for the graph with the method "Panel to XY coordinates". Keep a list of all the XY coordinates until the mouse button is released. This array constitutes your freeform boundary. The tricky part now is to get a list of 'cursors' (or do you mean data points?) that are contained in that boundary. Let us know when you make it that far.

Message 2 of 5
(2,452 Views)

Thanks!! I think I will give that a go, along with this: http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/point_in_polygon/ for determining if it falls within the freeform shape.

 

0 Kudos
Message 3 of 5
(2,442 Views)

Great! I was not aware of that polygon VI - it seems like it solves the problem perfectly. Best of luck.

 

-Garrett

0 Kudos
Message 4 of 5
(2,440 Views)

The map coords to XY invoke node on the graph really made it a cinch!

 

attached is the proof of concept for anyone else interested - pretty simple!

 

 

Message 5 of 5
(2,371 Views)