From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

Delete plot definitions from chart

Hi all. I'm struggling with a chart to which I programmatically add and remove plots. When I wire an empty array to the Value property it clears the plot, as expected, but each of the plot definitions still remains. This can be seen by simply inspecting the legend, snapshot below. How can I remove these definitions?

I've read that this is supposed to be a good thing, but it's not for me. I programmatically enlarge and shrink the legend to show the number of plots, so as the user clicks "Add Data to Plot" the legend size increases. This works fine, but once the legend reaches ten elements deep, I turn on the vertical scroll bar and keep the legend size constant. But the vertical scroll bar allows the user to see all previously defined (yet empty) plots, which looks terrible! Below are three more snapshots, showing 4 defined plots, 9 defined plots and 13 defined plots. You can see that in the third snapshot where only the first 10 are in the legend and the scrollbar is on, the user will be able to see lots more previously defined plot entries by scrolling down. How can I programmatically remove these definitions?

Message Edited by Thoric on 07-23-2008 10:29 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)

Download All
Message 1 of 25

Hi Thoric,

you can use a property node to select the active plot and change the property "visible" of this one. So you can hide some plots.

Hope it helps.

0 Kudos
Message 2 of 25
Thanks for the input Mike, but this hasn't worked for me Smiley Sad

See the snapshot - the Visible flag has simply made the plot symbol in the legend invisible, but it's still defined. You can see from here that I've added up to "test 14" in the plot, but there any many more in the legend. Right down to 27 if I scroll all the way. I really do need these to be erased. Is there really no way to un-define them at all? Smiley Sad

Message Edited by Thoric on 07-23-2008 12:01 PM
Thoric (CLA, CLED, CTD and LabVIEW Champion)

0 Kudos
Message 3 of 25

could you please post the VI?

CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 25

Hi Thoric,

so you want to clear the chart completly, is that correct? Can you show the code, how you dynamically add new plots?


0 Kudos
Message 5 of 25
Initially I need to clear the graph completely, but during program execution the user will be able to add and remove plots, any number of plots, to the chart. Therefore my legend grows and shrinks as the user adds and removes plots. When the chart has more than 10 plots, the legend needs to be the size of 10, but have the vertical scrollbar on so the user can scroll through the legend entries. The problem is, as shown above, that there are far more entries in the legend when the vertical scrollbar is on than the user has plotted.

See this attachment, which clears the chart, then adds up to 20 plots to the chart one at a time. When ten are reached, the legend scrollbar is made visible, and suddenly there are then up to 27 plots in the legend. I need all un-used plot definitions to be deleted so the user can't see these entries.

LV 8.5.1, Win XP Pro
Thoric (CLA, CLED, CTD and LabVIEW Champion)

0 Kudos
Message 6 of 25
Hi Thoric,
the inner for loop is the number of plots! You write more points to your chart as you want. See the attached example pease.
Hope it helps.
0 Kudos
Message 7 of 25
Thanks for the vi Mike, but I don't think it helps me.
You've replaced my waveform graph with a scope chart, and are using the History property to remove all defined data. My graph has no History property to call, so I can't do this.
I see that I used the wording chart above in my thread, where I actually meant graph, so maybe this has led to the confusion?

Also, when I call your vi a second time, with a reduced number of plots, it draws nothing? Although I do concede that the legend has the correct number of elements in it.

Can I mimic this History property somehow???

Thoric (CLA, CLED, CTD and LabVIEW Champion)

0 Kudos
Message 8 of 25
Hi Thoric,
sorry for the mistake. Please see this attachment. The minimum plots shown was 27 because you defined it in the graph properties. I think this should now work, like you need it.
Message 9 of 25
I'm now quite confused. Your attachment works. Just as I need it to. I made the very same changes to my copy of my code, and it doesn't work.
If I visually compare your to my, there are no differences, yet mine still fails to clear the unwanted plots from the legend.
Did you replace the chart in my example? Was it corrupt perhaps? Or is there some magic here??? Smiley Surprised

Message Edited by Thoric on 07-23-2008 02:03 PM
Thoric (CLA, CLED, CTD and LabVIEW Champion)

0 Kudos
Message 10 of 25