LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to chang the number of plots in the plot legend during run time?

Hi, I am using waveform graph. At run time only i will come to know, how many plots should be plotted in the waveform graph. Based on the number of plots i have to change the plot legend. Is there any method to do the same?
0 Kudos
Message 1 of 8
(3,278 Views)
Maybe something like this?
 
 
The inputs on the left are (from the top)
your array of data you want to plot (or anything that contains the number of inputs you have)
next one is an array of colorschemes (maybe you dont need this)
and the third is an array of booleans that are true if that "channel" should be plotted and false otherwise
 
/Anders


Message Edited by Tohatsu on 01-08-2008 08:56 AM
0 Kudos
Message 2 of 8
(3,266 Views)
Tohatsu was faster, but:
 
Using the Plot.Name property you can programmatically change the plot legend.
Attached you will find a little example on programmatic changeing the plot names, I think you can use it as SubVI within your codings.
 
Christian



Message Edited by Christian_M on 01-08-2008 08:59 AM
0 Kudos
Message 3 of 8
(3,264 Views)
Be aware that the example posted by Tohatsu is incorrect in that both the "N" is wired and the arrays are auto-indexed. You should do one, or the other, not both.
0 Kudos
Message 4 of 8
(3,256 Views)
oh, my bad, I've always been under the impression that N is the number of repetitions (like a gegular for loop) and the suto indexing selected the correct position from the array according to N (e.g. the 5th time, the 5th position in the array was selected)

but sorry for any misunderstandings.
0 Kudos
Message 5 of 8
(3,247 Views)
N is the number of repetitions. However, when you auto-index an array, LabVIEW determines the number of times to run the loop based on the number of elements in the array. So, in this case, the code is telling LabVIEW two ways to determine the number of times to run the loop. The one chosen is the lower of the two values.
0 Kudos
Message 6 of 8
(3,244 Views)
I am using Labview8.0. So, cvould'nt opent the attached file. Can u send it again in Labview8.0
0 Kudos
Message 7 of 8
(3,232 Views)
Christian's example vi in LabVIEW8.0

Message Edited by devchander on 01-09-2008 12:56 AM
0 Kudos
Message 8 of 8
(3,218 Views)