LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting data in a graph using mouse

I have some graphs showing good and bad quality data (some simulated data is attached). I would like a way of selecting individual traces of poor quality data using a mouse cursor, then removing them from the input array - while the vi is running, ie. not using the plot tools afterwards. 

 

  

0 Kudos
Message 1 of 4
(3,184 Views)

My easy method was to use the a single plot cursor and get the trace from the property node cursor.plot, then delete from array.

 

The other method I gave up on was to read the O/S cursor position, zero the cursor on a cross near the graph, then shift and scale the o/s cursor positions to get a value similar to that provided by the property node cursor.plot. I gave up because my next step was to search the array to find a trace with the nearest value to a cursor y-axis value. .. ??

 

Easy method is ok, but it requires the user to pick up the cursor and move it to the unwanted trace.

 

Any suggestions on either?

 

 

0 Kudos
Message 2 of 4
(3,174 Views)

When I have done this sort of thing in the past, I have always used the second method.  I used a free cursor or just the mouse instead of a cursor bound to a graph.  Some things that my help you get this done:

 

  1. If you have more than about four times as many points as the pixel width of the graph, you should be decimating the data for display to keep your update rates high.  This usually kicks in around 2,000 to 10,000 points.  Why do I mention this?  Use the decimated data to search for your waveform.  There is a lot less of it.
  2. The event structure will return pixel locations of a mouse down event.  These can be converted to scaled units using the Map Coordinates To XY method of the graph/chart.
  3. You probably want to implement an undo, in case you accidentally hit the wrong waveform.

Good luck.  Let us know if you have more questions.

0 Kudos
Message 3 of 4
(3,169 Views)

This is my half-finished effort. It contains the easy method and I started working on the mouse cursor section, but it looked too messy.

 

If you would like to add to it, please do! It has taken me too long now to justify finishing the second method.  

0 Kudos
Message 4 of 4
(3,161 Views)