07-17-2009 01:48 AM
Hello,
I have got a waveform graph to display measurement data. Sometimes there will be 40 plots shown. The plot legend also expands to 40 and I limit the number of elements shown in the Plot legend and I have activated the vertical scroll bar. Of course 40 plots are too many to work with. So the user has the ability to select plots to be shown. Now I want to decrease the number of elements in the plot legend as well. But if there were once 40 elements the plot legend remains in this size and the vertical scroll bar indicates that there are more elements than shown even if there are only e. g. two plots in the graph.
I don't want to increase and decrease the number of plots shown in the plot legend programmatically each time the user changes the number of plots shown. Secondly the plot legend shall have a maximum number of 20 elements (otherwise it would exceed my front panel). So I don't want to programmatically check whether to show the vertical scroll bar or not.
The legend should look like a partially filled array with grayed out elements.
How do I do this?
Is there a simple way to clear the plot legend and remove all entries?
Regards, Jörn
07-17-2009 03:32 AM
I would say passing an empty array of waveforms to the graph should actually clear the plot legend too.
Rolf Kalbermatter
07-17-2009 03:40 AM
07-22-2009 04:08 AM
Hi Jörn,
I created an example for you which should solve your problem. If you wanted to know something else, please let me know!
Best regards
Suse
07-22-2009 05:27 AM
Hi Suse,
your example does not exactly solve my problem. I wanted the plot legend always to show 10 legend entries.
But it helped me to find the solution: set LegNumRows to 10 and set LegPlotMin to the number of plots in the Graph (see attached example).
One thing is still missing: setting the plot number currently at the top of the legend. If you run the attached example with 30 plots shown, scroll the legend down and run the VI once again with 3 plots shown then you will see no plots in the legend despite the fact that all could be shown. You need to move the scroll bar first to see the 3 elements.
Best regards, Jörn
07-22-2009 07:05 AM
Hi,
I'm sorry but there's no property so become this effect!
So I created another possibility shown in the example which could be a solution for you!
Best regards
Suse
07-22-2009 08:09 AM
Hi Jörn
I'm not entirely sure what your after, but does this modification help at all?
Regards, Ian
07-22-2009 08:25 AM - edited 07-22-2009 08:25 AM
Hi Ian,
your modification makes it more clear why I want this special feature "setting the plot number currently at the top of the legend" (it should be like the property "Top Row" of a list box).
1. run your VI with "Number of plots to plot"=30
2. scroll down the legend to see plots 21 to 29 in the legend
3. now run the VI with "Number of plots to plot"=3
4. try to see the 3 entries in the Plot Legend... The user needs to activate the vertical scroll bar and scroll up. I wanted to do this programmatically.
Regards, Jörn
07-22-2009 08:54 AM
Hi Jörn,
I know the problem... but sadly there's no property to become this effect! Did you have a look at my latest example? Is this an acceptable solution?
Best regards
Suse
07-22-2009 09:48 AM
Hi Suse,
thanks, yes, I had. I already implemented such a feature to select curves. But in my VI only the selected plots are arrayed and displayed (and not set to an empty array as in your example). This has got the advantage, that if you are displaying e.g. curve 1, 14 and 15 the legend consist of three elements only and not of 16 elements as in your example.
It would be good to have a boolean property like "adjust display range" for arrays (I think the legend is based on an array) which automatically changes the top displayed element if the number of array elements is reduced so that the user always sees valid array elements. This property would be good for Listboxes as well.
Is that worth to be put on the wish list for future releases of LabView?
Regards, Jörn