LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatic control of waveform chart legend?

Hello,

 

I have a waveform chart which can display up to 16 plots.  The input to the waveform chart is a 16-element cluster.

 

My customer wants to be able to arbitrarily select which of the plots to display on the chart.  That's no problem -- I am using a property node (ActPlot and Plot.visible) in combination with a FOR loop to set which plots are visible and which aren't.

 

What I would like to do is have the plot legend display ONLY the plot name / plot color for the active plots.  Meaning, if plots 1, 5, and 8 are visible, the plot legend would only display "Plot 1" with its plot color, "Plot 5" with its plot color, and "Plot 8" with its plot color.  And nothing else.  That way, my customer knows which color corresponds to which plot, and therefore they know exactly what they are looking at if they happen to want to track multiple samples at once. 

 

What it seems to want to do is display all of the plot names in the legend, with an empty box (instead of the plot color) if the plot is not currently active.  Displaying all 16 plot names in the legend makes the front panel look awfully busy.

 

Is there a way to customize the plot legend such that only the active plots appear in it?

Thanks!

diane

Message 1 of 5
(3,355 Views)

Hi Diane,

when can you select the active plots? You can reorganize the data. so that you use the top number of plots. You can then use the property "legendrownumber" to show only the number of active plots.

 

Hope it helps.

Mike

Message 2 of 5
(3,333 Views)

Thanks Mike!  It was a bit clumsy to implement, but it worked.  🙂

0 Kudos
Message 3 of 5
(3,295 Views)
I was trying to figure out how you implemented Mike's solution but having no luck, could either of you tell me how you got this to work, I'm having a similar issue, thanks!
0 Kudos
Message 4 of 5
(2,998 Views)

Monse, this VI is a mess.

There are no comments, subVIs or typredef controls.

However, it might provide a starting point for doing it better.

 

James

LabVIEW 5.0 seems so long ago...
0 Kudos
Message 5 of 5
(2,969 Views)