LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to position cursor automatically by clicking in graph

When using cursors in Labview graphs it is quite cumbersome to move the cursors around quickly, because the need of grabbing the cursor first and moving it to the point of interest, and sometimes the cursor is outside the graph window and to bring it back you have to push "Bring to center" first. It would be much faster if it was possible to move the cursor just by clicking on the wanted position. Is there a way to do this programatically eg make an event which reads the position of the mouseclick and moves the cursors to this position? If this is not possible I think this is something NI should consider implementing in future LV versions.   
0 Kudos
Message 1 of 8
(5,369 Views)
Hi BBend:

I think it is not possible to get graph's values clicking on a graph. As it is not possible to get every value moving the cursor by the mouse (when a graph has too many points).

Just to add another way to set the cursor, you can enter your desired value in the x or y fields of the cursor, so that you get the cursor at the specific point.
Aitortxo.
0 Kudos
Message 2 of 8
(5,359 Views)

Look the Draw Graph with Events.vi shipped with labview. I would imagine you could adapt the techniqes used there to move the cursor.

Goto example finder and type in mouse into search. You should see the example listed after that.

David

0 Kudos
Message 3 of 8
(5,354 Views)

Hi David

I've looked into the example you suggested and it might be possible to modify it to get the cursor function I want. The only problem I can see so far is how to disable this function when using the zoom-tool instead of cursors. Anyway, I find it a bit strange that this hasn't been implemented as an option in the Graph control, as this cursor function is very common in other programs. Is there a link to where I can suggest this improvement to LV?

 

0 Kudos
Message 4 of 8
(5,334 Views)
 
David
0 Kudos
Message 5 of 8
(5,331 Views)

You could use the Palette:Active Tool Property

Property of GraphChart.

Sets the tool that is currently selected on the graph palette. 0 is the selection cursor, 1 is the panning tool, and 2-7 are the zoom tools

to detect which tool you have selected

0 Kudos
Message 6 of 8
(5,329 Views)
Thanks David for very quick reply. I'll post a suggestion soon and hopefully they agree with me.
 
Bård
0 Kudos
Message 7 of 8
(5,320 Views)

Don't know if you found a solution that worked for you, but I was working on the same problem and came up with a solution that uses a "Mouse Up" event. From the coordinates of the "Mouse Up" event, it invokes a node to get the XY coordinates from the pane coordinates, then uses the Property Node "Cursor Position" to set the cursor to that position. Seems to work pretty well. I didn't look into it enough to allow changing within the cursor legend (the mouse up event will prevent you from changing it), but I'm sure you it wouldn't be too much hassle.

 

Michael

0 Kudos
Message 8 of 8
(5,142 Views)