LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get colors of selected plots

Solved!
Go to solution

Hi,

I don't know how to exactly explain my problem but I'll try:)

I want to get colors of multiple plots and show them next to buttons that switch on/off selected signals.

For example I have 4 signals: sine, square, saw, triangle, so when all of them are switched on:

signal  -  color

sine  -  white

square  -  red

saw  -  green

triangle  -  blue

 

but when I switch off square wave:

sine  -  white

square (which is switched of)  - red

saw  -  green

triangle  -  black (default color)

 

and should be:

sine  -  white

square (which is switched of)  - black

saw  -  red

triangle  -  green

 

I tried to do it but I don't know how:( can anyone help me? any solutions?

I attached my vi's - LV 2010 and 8.6(zip)

Regards

Mike

Download All
0 Kudos
Message 1 of 6
(2,884 Views)
Solution
Accepted by topic author MeeHow

You're misunderstanding the meanings of a plot's existence, its color, and its visibility. In your code you are taking certain plots completely out of the picture by eliminating their existence via the Select Signals Express VI. That doesn't change the colors of the plots or their visibility. Thus, regardless of how many waveforms you feed the graph, the visibility and colors won't change. If, instead, you wire the array of waveforms to the graph, then you can control the visibility of a plot from your array of buttons by setting the "Visible" property of the active plot. This still won't change the color of the plot - it just makes it non-visible. However, you can use the Visible property to determine whether to spit out the actual plot color, or just the color black.

 

As for the actual implementation, you do not need to do this in a subVI, as it's more expedient to do this right in the loop. Also, Index Array can be resized.

 

See attached modification

Message 2 of 6
(2,874 Views)

This is exactly what I need:) 

Thanks a lot!

0 Kudos
Message 3 of 6
(2,870 Views)

Uhm, wait...

It's not good enough for me:( I need signal selector and waves can't be just hidden cause it was only part of my project, after this part I've got some measurments (RMS, FFT) and I won't work correctly, and other graphs show all of signals:(

Maybe it will be easier to set color individually for each signal?

0 Kudos
Message 4 of 6
(2,862 Views)

I don't understand your question.

0 Kudos
Message 5 of 6
(2,851 Views)

I don't know how to explain it more clearly...

Look when I'm using hiding signals and math formulas... for example first signal * second signal

s1 * s2

and I have 3 signals: 1.sine, 2.square, 3.saw

When all of them are switched on its sine*square right?

but when sine is off it's still sine(hide)*square right?and the result will be the same

should be square*saw!

0 Kudos
Message 6 of 6
(2,847 Views)