LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get mouse properties from Graphs/Charts?

Hello,

My problem is the following:

I have a graph that displays some data and two cursors.
Next to it is a button that allows users to select whether
they want to see all data, or a selection based on the
cursors. When in the selection mode, the cursor can be
dragged to change the data shown, but the graph is updated
while dragging. I wanted to make a simple wait-while-mouse-down
call, but this seems to be more complex than I imagined.

I know the example that uses the picture frame to get the mouse
properties, but the picture frame blocks cursor usage. Is there
another solution to my problem?
0 Kudos
Message 1 of 5
(3,209 Views)

@hoofdvolchips wrote:
...When in the selection mode, the cursor can be dragged to change the data shown, but the graph is updated while dragging...


Sorry, but I don't understand your problem. Could you give a more detailled information, and post an example vi illustrating the problem ?

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 5
(3,189 Views)
There's a graph in the VI that I want to update after a cursor has been moved in that graph, but not before I stopped moving (dragging) the cursor. I figured I should build a wait loop that waits while the mouse is down over the graph (i.e. I'm probably dragging a cursor), and updates only after I released the mouse.

This could probably be done with a while loop, with the stop condition linked to some property node that reads 'mouse down'

So far, the only structure I have found that can read those properties is the 'figure' element (There is an example bundled with labview that illustrates this). But, placing a figure element on top of a graph no longer lets me select the cursors, so it doesn't work for me.

I've included a quick-and-dirty example to illustrate my problem.
0 Kudos
Message 3 of 5
(3,179 Views)
There is no "mouse down" property. What you should use is the event structure. If I understand you correctly, the best way to go is to use the "mouse up" event to update the graph. This means that whenever you release the mouse button over your graph it'll update. You can also use events, for example, to detect a mouse click or a mouse move. See LabVIEW help for how to use event structures.

___________________
Try to take over the world!
0 Kudos
Message 4 of 5
(3,170 Views)
Hello,

The best way to achief this is using an event structure to capture a mouse button up. I have changed your program in a way that it uses an event structure to look at the waveformgraph. As soon as a mousebutton up occurs, it stops the while loop where it is waiting in and updates the graph according to the new currsor settings.

Best regards,

RikP
Application Engineering
National Instruments
Rik Prins, CLA, CLED
Software Development Engineer
0 Kudos
Message 5 of 5
(3,167 Views)