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: 

moving xy graph cursor with mouse and programmably controlling snap to point

Hi,

I have run into a bit of a problem. I am trying to create a program which allows a user to select a location on an XY graph by simply clicking in the vacinity of the plot. Most of it is working, however I find that I can't programmably control the snap to point function reliably.
I hope this is a clear outline of the problem:

- The cursor starts in a Free state, so that when the
user clicks in the plot area, I can set the cursor
position to the nearest point by setting the
CursorPosition using the graph's property node.

- Maybe the user didn't like the chosen location and
wants to drag the cursor over a bit. Ok, user drags
the cursor to a new position.

- Now th
e cursor position is probably not exactly on
the plot trace. If, at this point, I set the cursor
to Snap To Point, the cursor does not snap to the
nearest point on the graph (relative to its current
position), but instead to the last place a _mouse_
action placed it.

- Immediately after the new location has been set,
the cursor state has to be reset to free in case I
need to programmably move the cursor again (I
can't seem to programmably control the mouse in
any state but Free)

How do I go about getting the cursor to snap to the closest point at it's new location? I'm at a loss.

Any insight you might have would be greatly appreciated.
Thanks much!
Tere
0 Kudos
Message 1 of 4
(3,544 Views)
Let me make sure I'm seeing what you want to do. You want the user to be able to move the cursor anywhere on the plot and have it always on the plot itself, not somewhere else on the graph? Instead of using the CursorPosition to set it the first time, you can just set it to "Snap to Point" in the Lock Ring settings on the front panel. Is this what you are looking for?
J.R. Allen
0 Kudos
Message 2 of 4
(3,545 Views)
So what is the question about... I have to use XY graph in my program. It is used in Loop while cycle. It shows the statistic of a variable. I am using cursors in this graph to check the actual value of a variable in different period of time. But there are 7 variables and it is extremely hard for user to check each value independently. So I tried to make them moving on the X axis (TIME) together using the property node (cursors reading the position (only X axis, Y axis status lock to plot) of the major cursor and follow it... Everything looks great? But it did not work when I am trying to move the major cursor manually on graph... It works only when I am using the cursor movement buttons... But they work very slowly when there is a lot of data in graph.

I want to find out is it possible to make seven coursers mouthing together By the X axe and be Locked each at its plot by Y axe manually (Using mouse moving on a graph). Is it possible? If it is than how to do it?
0 Kudos
Message 3 of 4
(3,523 Views)
Hi Shidla !

I think you misusing this forum. Do not add your own question as an answer to old posts ! Ask your own question in a new thread...

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
Message 4 of 4
(3,510 Views)