LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot selction

Hi

I am making a program with multiple plots on one graph, and I want the user
to be able to do some calculations like finding max of an plot. So I need
some way to let the user select witch plot is 'active' and visualize it.
Does anyone have an suggestion?
Thanks

/ Peter
0 Kudos
Message 1 of 7
(3,396 Views)
Hi,
here's a little example useing the property node of the graph that looks for the Max on a plot. Technically, you're not going to use the active plot property of the graph, as it doesn't contain a copy of the data - knowing the order in which the plots are stored in the graph's value property allows you to index it out though.

Hope it helps. (After you've started it running, change the value of the plot text ring on the right to see the effect.)

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 7
(3,396 Views)
> I am making a program with multiple plots on one graph, and I want the user
> to be able to do some calculations like finding max of an plot. So I need
> some way to let the user select witch plot is 'active' and visualize it.
> Does anyone have an suggestion?
> Thanks
>

Some possibilities are, Boolean selectors next to the plot legend, a
listbox next to the graph, or a small ring control next to the buttons
that perform the measurements or display the results.

Once you have an index, this is an input to the property for Active
Plot. If you want to hilight the plot, some options are color -- dim
the others, brighten or change the color of the active one. You could
also use dashes -- make the active plot solid and the others dashed.
You could also m
ake the active plot width larger, but this makes it
harder to see details.

You will probably want to place some cursors on it. you can customize
the appearance, perhaps getting rid of the lines that span the graph,
adding text, making it non-draggable, etc.

Greg McKaskle
0 Kudos
Message 3 of 7
(3,396 Views)
Hi

....
> Some possibilities are, Boolean selectors next to the plot legend, a
then I will have to program the xor'ing(only one selected) my self, so that
I don't like.

> listbox next to the graph, or a small ring control next to the buttons
list box - that is an good idea. 🐵

....
> Once you have an index, this is an input to the property for Active
> Plot.
Why do I need to make my plot active? I still need to use 'index array' to
get the data of the right plot?
Can it realy be true, that there is no build in way to let the user select
the active plot?

> If you want to hilight the plot, some options are color -- dim
> the others, brighten or change the color of the active one.
....
I would like to change the the color of the 'active' plot to white, but
when
it is no longer active it's old user selectable color should be restored -
how do I save this color, or only overwrite it temporarely?


Thanks for your answers


/ Peter
0 Kudos
Message 4 of 7
(3,396 Views)
> Why do I need to make my plot active? I still need to use 'index array' to
> get the data of the right plot?
> Can it realy be true, that there is no build in way to let the user select
> the active plot?
>

The graph in LV is mostly for online display. It contains cursors and
markers for basic annotations, but it is not by itself a scope or an
analysis package. Luckily it is quite easy to add these things to
customize it by using the diagram.

Making the plot active is so that the property nodes for the plots will
affect the active plot. For instance when you make a new plot active,
you can then read its color, shove it into a shift register, a color
indicator that is hidden, or whatever else you like to save off the
color, then
set the plot color to white. You are correct that you will
need to index the data yourself since multiplots come in all different
datatypes.

Greg McKaskle
0 Kudos
Message 5 of 7
(3,396 Views)
you might be able to modify this vi to suit yours.

hope it helps.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 6 of 7
(3,396 Views)
Hi Peter,
I've adapted my earlier example to give you your "hi light" of the selected plot. This is done through the active plot property, as we're dealing with the plot attributes, and not the data itself. The list of colours is either forced (as in the attached example), or the plot colours could be retrieved from the graph before data is written, either way, an array of these colours is required to be able to index through the plots to hi-light the new plot, and re-instate the original colour of the old plot.

Hope it helps

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 7 of 7
(3,396 Views)