08-13-2012 10:43 AM - edited 08-13-2012 10:49 AM
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).
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:
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! ![]()
- James
P.S. This idea is subject to change as better ideas are suggested.
08-13-2012 10:53 AM
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.
08-13-2012 10:55 AM
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?
08-13-2012 10:59 AM
@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.
08-13-2012 11:06 AM - edited 08-13-2012 11:06 AM
Thank you for the lead. I'll get back to you soon with my progress. ![]()
08-13-2012 11:07 AM
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.
08-13-2012 11:07 AM
Do you mean something like this?