LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a 'Plot Legend' with a specific layout?

I think I may want/need to design my own legend to fully accommodate the requirements.  Either way,  think I'll be needing a bit of help/guidance please!

>>  I am using LabVIEW 8.5

 

I am constructing a piece of test software that needs to be suitable for testing a range of electronic units produced at my company.  So far so good, but I am wondering if I can get more control over the plot legend.  I have set aside a section of the front panel for the plot legend as shown by the red outline in the attached picture.  The blue outline at the right of that is for a possible scroll bar (more on that later).

 

Legend.JPG

 

The graphs will all have the same legends (so only one need be displayed) despite showing different data.  I will have to allow for the user trying to display any number of plots on the graphs (or is there a hard-coded limit in LabVIEW).  The plots will be organized into a two-level tree and the two levels could be ether way round; these are 1) Frequencies, and 2) Temperatures.  The former will usually have up to 7 plots, and the latter up to 3 (though both could in theory be more than this in special cases).

 

For example:

Legend 2.JPG

 

This would be a 'worst-case' scenario where all 5 frequencies are being displayed at all 3 temperatures.  However, they could want to display all 3 frequencies at one specific temperature - in which case the sub-section title would be the frequency and the temperatures would be the plot names.  If the legend is too tall for the space it may need a scroll bar to stop it overlapping other controls lower down.  Also, I don't want the legend taking up too much sideways space if the plot names happen to be very long (this shouldn't be as much of an issue since I know largely what they'd be, but it might be worth adding in as a safeguard).

 

The data to construct the legend would come from two numeric arrays (one of frequencies and one of temperatures) along with two boolean arrays to signify which data from each array to display on the graph.  By default, I will have temperatures as the higher-level category (as in the second picture), and there may not be a need to change this at all (despite my earlier musings).

 

From what I can see, there is very little I can do with the generic LabVIEW plot legend so I think I am asking for help to create my own.

 

If you can think of anything that would help (even if it means sending me down a different route), please say so!  Smiley Happy

 

- James

 

P.S. This idea is subject to change as better ideas are suggested.



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 1 of 7
(3,777 Views)

I admit I didn't read the whole post in great detail, but have you thought about using subpanels? You could essentially create a VI that looks like a legend and is loaded into a subpanel next to your graph. If you really want to get fancy, you could wrap this kind of thing into an X Control, but that would take some design time for sure.

Message 2 of 7
(3,766 Views)

By 'subpanel' do you mean a subvi whos front panel is just positioned above the main vi's FP, or is there a way to actually embed it into the main one?



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 3 of 7
(3,760 Views)

@James Mamakos wrote:

By 'subpanel' do you mean a subvi whos front panel is just positioned above the main vi's FP, or is there a way to actually embed it into the main one?


You can actually embed.  Look in the Containers palette for the subpanel.  If you go into the example finder and search "subpanels", you will find a few good examples of how to use them.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(3,757 Views)

Thank you for the lead.  I'll get back to you soon with my progress.  Smiley Happy



Never say "Oops." Always say "Ah, interesting!"

0 Kudos
Message 5 of 7
(3,751 Views)

I believe you can add scrollbars to subpanels also, so you should be able to get the effect you are looking for. It basically will embed another front panel in your front panel. You can make the border of the subpanel transparent if you don't want to see it, or you can customize the border so it looks like your drawing.

0 Kudos
Message 6 of 7
(3,749 Views)

Do you mean something like this?

 

0 Kudos
Message 7 of 7
(3,748 Views)