LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph Legend Index

I've seen this type of issue posted in the forums but never saw a resolution, or if anything was going to be done about it as a bug/issue/feature request.  Lava Crosspost.

 

Basically you have a list of channels that you can view on a graph. As you choose more signals, the plot fills up, and the Plot Legend fills with the signal names. I have it set to show no scroll bar on the legend until you have more than 11 signals. There is no limit to the number of signals on the graph, (this test VI only has 20) and so to see all the signals you'll need to scroll. This all works fine. The issue is when you select many signals, then scroll down, then select only a few signals. The scroll bar will disappear (by design) but the value of the scroll bar stays the same, showing a blank plots. Without the scroll bar you cannot change the value and are stuck until you select more than 11 signals and scroll up.

So my question is this, is there a decent work around people have found? I can't find a property of the control that allows me to set the value of the scroll bar (or the optional index) back to zero. I also don't want to show the scroll bar when there are so few signals that it doesn't need to be seen. I would prefer a XControl that replaces the vertical scrollbar with one with more control, as well as not allow you to scroll down past the number of signals on the graph. 

 

After some searching I found this post, without a resolution, and this item at the idea exchange. Any help would be appreciated thanks.

0 Kudos
Message 1 of 16
(5,857 Views)

I can't offer a real workaround off the top of my head, but I believe you can Right-Click the empty plot name and choose 'Show Last Element' to recover.  Not exactly an ideal UI experience!

0 Kudos
Message 2 of 16
(5,851 Views)

I very quickly played with one workaround:  Use two Graphs in the same location, one showing the legend scrollbar and one hiding it.  Write values to both, but determine the visible one by how many rows are displayed (I sometimes use invisible Tabs instead of hiding/showing controls).  You could add a little code to copy the plot propeties back and forth in case the user changes plot styles.  Still not ideal, but not too bad in my quick test.

0 Kudos
Message 3 of 16
(5,834 Views)

You can vote on this and this (I encountered the same issue as you here). The scrollbar sounded like a good idea when NI created it, but they just forgot this little property of arrays (first shown element index)...

0 Kudos
Message 4 of 16
(5,823 Views)

Similar problem... I want to show different data in 4 graphs, but I want allow to user to select it... Maybe there are more plots than shown, for this reason, I need to use the scroll bar. But I need to know the index to show the same index of the 2D array of boolean that makes visible/invisible every plot in every graph.

 

graph.png

 

The legend shown corresponds to a not-visible graph. One solution consist of make a self-legend, using a cluster with the booleans and string with the plot name. But I want to conservate the legend of the graph because I want allow user to change the plot properties (color, etc.) and replicate it tho the other 4 shown graphs... 

 

Any idea or workwaround?

 

Thanks and regards,

 

     Jaume

0 Kudos
Message 5 of 16
(5,784 Views)

Jaume,

 

I'm having trouble understanding the issue that you'd like a workaround for.  You want the user to be able to select which plots are visible.  You must use the scroll bar to make sure the user can see all of the selectable plots.  You’ll need to know the index of the selected plots to be able to programmatically make them visible.  Can you reiterate exactly what functionality you’d like to incorporate that you haven’t been able to?  I may be able to suggest a workaround, but I’d like to be sure I fully understand the issue at hand first.

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 6 of 16
(5,765 Views)

Jared,

 

    yes, you are right. The user has to be the ability to select which plots to see in every graph, using the 2D array boolean on the right. If I move the legend of the hiden graph (I use it as "main legend" for all graphs), the 2D array must move solidary, to show the same index of the first element of legend. This is a problem if I don't know which index the legend is showing.

 

    One possible workaround is program a "custom legend" with an array of clusters that contains name, 4-elements array for visibility, etc. but I loose the "plot configuracion" functionality (color, line width, etc.)

 

     thanks!

0 Kudos
Message 7 of 16
(5,753 Views)

Jaume,

 

I've attached a very simple VI that uses the Horizontal and Vertical Splitter Bars to divide up the block diagram.  Could you disable the scroll bar on the plot legend itself, expand it fully, and just use the scrollbar of the Vertical Splitter Bar?  This way the whole window will scroll together, and the 2-D array of Booleans will always match up to the correct plot.  

Regards,

Jared R.
Precision DC Product Support Engineer
National Instruments
0 Kudos
Message 8 of 16
(5,742 Views)

Jared,

 

   this is an innovative idea!

 

      thanks,

 

          Jaume

0 Kudos
Message 9 of 16
(5,739 Views)

@JaredRo: this is not a satisfactory workaround because it will allow you only to see the graph legends that have been displayed. In other words, if you have 15 plot legends displayed and the scrollbar brings you down to the region where you would expect plot 20 to show up, you would have to go through many hoops to figure out where you are (virtually), set the new number of visible plots in the legend, etc... A lot of work to go around a missing feature that I personally would really appreciate NI to acknowledge and issue a CAR for.

Seriously.

0 Kudos
Message 10 of 16
(5,724 Views)