LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Any way to control whether chart plots are visible with a boolean switch?

Solved!
Go to solution

I'm graphing a waveform chart w/ a cluster and 10 doubles, that will auto update with new data when my program loops (it should output 10 separate plots onto the same chart). 

I want to be able to choose which plots are visible. I'm sure you can do this on the front panel by going through chart properties, but I want to be able to hit a button on the front panel that causes the data to become visible. Does anyone have any ideas on how to accomplish this? Is it relatively easy/feasible (it seems like it would be)?

0 Kudos
Message 1 of 7
(3,542 Views)

Hi!

You can do this iterating through all plots in your chart. For each plot, enter its index into ActPlot and set its visibility using Plot.visibilty.

Attached is a snippet that you drag onto you diagram and it will build the code.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
Message 2 of 7
(3,512 Views)

thanks for the help! I looked into something like this but this seems the most efficient.

 

I want a switch for every different plot on the front panel (so I'll make the boolean a control), would it make the most sense to employ some kind of case structure as well (just off the top of my head, I've only been working with labview for a week or so)?

0 Kudos
Message 3 of 7
(3,499 Views)

You will want to use an event structure.  For things like this I usually use a boolean array where the size = number of plots, then trigger the plot.visible based on the array value change event.

Message 4 of 7
(3,495 Views)

great, I'll look into mixing both ideas. Thanks!

0 Kudos
Message 5 of 7
(3,493 Views)

Hello,

what about showing 'Plot Legend' and activating 'Plot Visibility Checkbox'?

All build in, no programming.

plot_visible.png

UliB

Message 6 of 7
(3,482 Views)
Solution
Accepted by topic author GV_KawaiiDesu

If you want a control for each plot, UliB is right !

Just use the native checkbox availble directly on the chart (right clikc the plot palette and activate Visibility Checkbox).

If you want to have the boolean controls somewhere else on your pane, then do as I was explaining in a previous post. And yes, you can make it efficient using an event structure to detect when  / which plot to update.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 7 of 7
(3,476 Views)