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: 

Why does the graph cursor (snap mode) snap to unvisible curves? How can i change that?

I display several curves in one graph. To get a better overview the user can filter unwanted curves by setting the attibute to unvisible. There is one cursor switched on in the graph with the option "snap to plot". The user can move the cursor and read the coordinates and curvename. Unfortunately the cursor snaps also to the unvisible curves. How can I block that behaviour? The cursor should only jump on the visible curves.
0 Kudos
Message 1 of 7
(3,353 Views)
Hi Albertz,

in a multiplot graph each plot has a reference number form 0 to n-1 (n is the number of plots).
You should use the property Cursor.Plot to set with which plot a specific cursor is associated.

Let me know if you need more help,

Alberto
0 Kudos
Message 2 of 7
(3,353 Views)
with the property Cursor.Plot I can set or get the current plot number of the cursor, but I cannot prevent the user to move the cursor to an unvisible plot. Labview allows the cursor to be moved to a curve witch is unvisible in the graph. I want the user only to be allowed to jump betwen the visible curves.
0 Kudos
Message 3 of 7
(3,353 Views)
If you cannot prevent it does not mean it is not possible!
Here is an elementary example how to do it.
Think it over before rating.

So long,

Alberto
0 Kudos
Message 4 of 7
(3,353 Views)
> with the property Cursor.Plot I can set or get the current plot number
> of the cursor, but I cannot prevent the user to move the cursor to an
> unvisible plot. Labview allows the cursor to be moved to a curve witch
> is unvisible in the graph. I want the user only to be allowed to jump
> betwen the visible curves.
>

The graph cursors can be locked to a particular plot or set to snap to
any plot/point on the screen. You cannot see invisible plots, and you
probably can't see black plots on a black background, but the graph
intentionally lets you place cursors there and other users wouldn't be
happy if it changed.

What we will likely add at some point is a way to truly show and hide a
plot. In the meantime, you can also just change w
hat is plotted.
Hidden plots can be removed, no points, and the cursors will not go there.

Greg McKaskle
0 Kudos
Message 5 of 7
(3,353 Views)
What we will likely add at some point is a way to truly show and hide a
plot.

I wonder why this has not been implemented yet? I can't see any reason we would want cursors to snap to points that are not visible. I'd just call this a bug, and fix it.

Message 6 of 7
(2,482 Views)

This is me replying to my own question under a new alias.

 

I found the solution that worked for my case: If a plot is disabled I fill it in my Graph with an array created from a numeric constant with the text "NaN" entered in it. I keep a data array with the original data, that use to I restore the data when the user enables a plot.

 

I had never known that NaN could be used as a numeric value!

 

When a Graph plot is filled with NaN, it's ignored by the cursor even when the cursor is in multiplot mode.

 

In my case this was a simple and elegant solution.

0 Kudos
Message 7 of 7
(803 Views)