Showing results for 
Search instead for 
Did you mean: 

programmatic legend plot name display



I'm writing a VI that displays multiple wave forms that are calculated from data that is read in from multiple .csv files. Each data file provides data for 32 plots.  I have it set up to read in anywhere from 1 to 10 data files, and am using "strip path" to name the data in the legend via property node "ActivePlot -> PlotName" in a loop.  So I have anywhere from 32 to 320 plots on my xy graph with anywhere from 1-10 plot names(32 like filed plots get the same name).


The Problem:


I only need to the display one plot name for each data file in the legend (i.e. plot 0 for each data file), but the legend is linear in that it displays plot names in the exact order of plotting.  Outside of completely reordering the plot array, does anyone know of a more elegant way of coercing the legend to display only specific plots? I can't find anything in property nodes that does this and haven't stumbled on this problem in the forum (hopefully I didn't miss it).


Thanks in Advance!

0 Kudos
Message 1 of 7

Sorry!   Forgot to mention that I'm in LabVIEW 8.5


: -)

0 Kudos
Message 2 of 7

If I understand your question you would like to associate a name with your waveform so that sepending on the waveform the correct name is plotted.

I would use the waveform attribute 'NI_ChannelName' on your waveform, this will automatically name your plot without any additional progamming.  This is what daqMX does and how your channel names are automatically determined from the express vis.



Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 7



Yes, I believe that would work if I was using waveforms.  My data is all in an array of clusters that I'm plotting in XY graph.  Can I apply signal express vi's to data arrays?



I guess if I were to try to explain more clearly what I'm trying to do, I have a 320 length array of clusters, and each cluster is a data set that I'm plotting.  Is it possible to display the plot names only for plot #'s  0, 32, 64, 96, 128, 160, 192, 224, 256, and 288 in the legend of an XY graph?


Thank you for your reply!

0 Kudos
Message 4 of 7

Hi AJee,


I do not see a clear way of selecting specific legend entries or moving specific legend entries throughout the list. It would be possible to move those specific plots to the front of the array and then specify how many items you would like to have visible (i.e. change the array order so that plot 0, 32, 64, 96, etc are first followed by the remainder of the unlabeled graphs and change the size so only the desired legends are visible)


If I understand correctly, you are trying to plot 320 separate plots on one graph?

Message 5 of 7



Yes, I had a feeling that would be the only way.  Yes I am plotting up to 320 plots on one single graph.  I then color coordinate the plots so that each consecutive set of 32 plots is the same color (each set of 32 is data from 1 part in my application, which is counts vs tube current for radiation detectors under Xray irradiation).  So, naturally you can understand I'm looking to be able to visualize the overall behavior of each part (up to 10 parts at a time), in comparison to the other 9 parts.


Unfortunately, after I apply the above described color coordination, if I then rearrange the array for purposes of the legend, the colors will no longer be coordinated correctly and hence defeat the point...  I will have to use another method for displaying the labels.


Thanks a bunch for your reply!  I can now move on to said secondary method.



0 Kudos
Message 6 of 7

Although you are not using the waveform plots you could still employ a similar approach.


Your data is an array of clusters where each cluster is a data set and a set of properties like string name, int color, enum y-axis....

when you lopt your data, use a subset of the array containing only the clusters you wish to plot, then use these extra fileds to adjust the plot index properties.  Although this requires programming, you can make it very scalable (ie add new mata data fields to your cluster and add code to use them) and use the power of the original plot ledgend (that has huge number of features that would be hard to replicate). 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 7