06-01-2017 07:52 AM
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)?
Solved! Go to Solution.
06-01-2017 08:33 AM
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.
06-01-2017 08:56 AM
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)?
06-01-2017 08:59 AM
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.
06-01-2017 09:01 AM
great, I'll look into mixing both ideas. Thanks!
06-01-2017 09:39 AM
Hello,
what about showing 'Plot Legend' and activating 'Plot Visibility Checkbox'?
All build in, no programming.
UliB
06-01-2017 09:47 AM
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.