LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to adjust plot names visibility in the legend of a XY-graph automatically

Solved!
Go to solution

I have a XY garph that shows 3 plots. Sometimes I need to close some plots on the graph. I can do it. But I also want to delete the plot name on the legend of the graph too, I could not do it. How can I do it? The program is attached.

Egemen
0 Kudos
Message 1 of 7
(3,361 Views)

You can do this, but it will require a change to the way to display the plots.  The legend always shows all plots which are present.  To remove the plots from the legend, you need to remove the plots from the graph rather than just hiding them.  You can do this by selectively adding plots to the final plot instead of always including all of them.  Your boolean array will work as a flag to do this.  In addition, you will need to dynamically set the name of the plots.  This can be done using the plot name property.

 

Let us know if you need more help.

0 Kudos
Message 2 of 7
(3,334 Views)

I tried sth but I cannot do that. How can I do?

Egemen
0 Kudos
Message 3 of 7
(3,324 Views)

Is this a solution for your topic?

 

Andrei

0 Kudos
Message 4 of 7
(3,305 Views)

Thank you andrey2006 but this is not the solution. This vi does the same thing that I sent previously. The only difference is that the vi you preapered deletes the plot names too. Besides, I want to resize the legend just for visible plots too. I have not found the solution yet.

 

Edit: Pictorial expalanation is attached.

Egemen
0 Kudos
Message 5 of 7
(3,300 Views)
Solution
Accepted by topic author newbieeng

The solution is actually a bit more complex than you may expect, since you have to change both the plot and the plot characteristics.  Attached is something that should work, although it is not very optimized and has some momentary, expected, display glitches.

 

I do not have LabVIEW 2009 on my development computer, so I edited it in LabVIEW 2011 and saved for previous.  I don't think I used anything new, so it should work.  Let me know if you need more info.

Message 6 of 7
(3,281 Views)

Hi DFGray. This is exactly what I want but I have never thought that it could be as complex as that one. It works in version 2009. I need to study this code a little to get the idea. Thank you very much.

Egemen
0 Kudos
Message 7 of 7
(3,279 Views)