10-31-2021 11:35 AM
I'm able to control the x and y cursors via slide but I'm trying to figure out how to setup hovering with mouse to move the x and y cursors
Solved! Go to Solution.
10-31-2021 01:01 PM
LabVIEW Graphs have a "Cursor" associated with them. You can learn about them using LabVIEW Help. The quickest way to the most useful part is to do the following:
Bob Schor
10-31-2021 01:19 PM
I read through it and did the examples already. I tried to look on google and youtube for more specific help. I'm trying to free drag real time with my mouse cursor.
10-31-2021 03:56 PM
You failed to attach your code (files ending in .vi) so I can't see what you did. I don't understand what you mean by "free drag real time with my mouse cursor".
I just made a little VI that generates 30 random numbers as an Array and writes it to a Waveform Graph.
To get the Cursor to appear, I right-clicked on the Graph, chose "Visible Items", and selected "Cursor Legend", which gave me a blank Cursor Legend. I then right-clicked the Cursor Legend and chose "Create Cursor", specifying "Single Plot" (as I want the Cursor "linked" to the Plot). I haven't played with the Cursor "Style", so it shows up as a pair of Yellow Lines that intersect on points in the plot. With my mouse, I dragged this Cursor to the right and "dropped" it at X = 18, and it tells me Y = 0.17223.
Did you read the LabVIEW Help section I mentioned to you? Did you try something like "Add cursor to graph in LabVIEW" in a Google search? What did you try?
Bob Schor
10-31-2021 06:53 PM
The cursor position property values correspond to the x/y scale of the trace that it is attached to, while the mouse coordinates are in pixels relative the the origin of the pane, so you need to do some translation. Additionally, since you can only get an event for a mouse move over the entire control, you probably want to check that the mouse move event occurred on the actual plot first.
Something like this should work if you just want the x-position of the active cursor to follow the position of the mouse.