NI Home > Community > NI Discussion Forums

LabWindows/CVI

Reply
Member
jmoses
Posts: 76
0 Kudos

Snap graph cursor to nearest visible plot

In LabWindows/CVI, it is wonderful that the user can use the graph cursor to snap to the nearest data point.  But my graph contains both visible and invisible plots.  I want the graph cursor to snap to the nearest data point of a visible plot only, ignoring the invisible ones.  Advice?
 
Josh Moses
The Modal Shop
 
Active Participant
LuisG
Posts: 1,929

Re: Snap graph cursor to nearest visible plot

Josh,

You can configure whether a cursor can snap to a particular plot by setting this plot attribute:

SetPlotAttribute (panel, graph, plot, ATTR_PLOT_SNAPPABLE, 0);

I might have expected hidden plots to not be snappable by default, but apparently they're not, so you'll have to also set this attribute whenever you hide a plot.

Luis
NI
Member
jmoses
Posts: 76
0 Kudos

Re: Snap graph cursor to nearest visible plot

Great!  Thanks so much!