LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Autosizing plot legends

I turned on Autosize Plot Legend on an XY Graph.  At one time the legend for a plot was very long. Now that the legend is short again, the autosize sets to the legend size to the old plot with the long legend name.  Is there a way to programatically remove the old plots names from the graph "history" so autosizing works properly?

 

New Bitmap Image.jpg

0 Kudos
Message 1 of 7
(4,069 Views)

Edit: so the "LegNumRows" can give you the option to set the number of rows. Since there is no way directly to delete a Plot from the Graph (I mean with the legend too), you could just rename any of the Plots as needed. So set the number of raws, and rename the Plots. In this way you can have total control on the visibility. The data order will decide what you connect to the XYGraph how your data will be displayed (changing names does not change any order in the Graph plot list itself).

You can always set first the active plot, and then operate on that plot, like this:

 

UserInterfaceEventPattern 1_BD.png

 

legend_xy.png

0 Kudos
Message 2 of 7
(4,051 Views)

This is not what I am trying to do.  I am trying to clear the names from the "History" on the drop down on the Plots tab in the Graph properties as shown in the original post.

0 Kudos
Message 3 of 7
(4,043 Views)
See my edit.
0 Kudos
Message 4 of 7
(4,036 Views)

You can also find useful free toolkits via the VIPM ( http://vipm.jki.net/ ). For example, the MGI Graph functions can save some programming time for you 😉 http://sine.ni.com/nips/cds/view/p/lang/en/nid/209753

 

Like you can easily specify an array of string for the Graph, and change all of them at once. Full control on the plot names:

 

MGI1.png

Message 5 of 7
(4,030 Views)

Thanks, this looks interesting.  Does this also remove the names if you shorten the list?  I can rename them in LV now, just can't remove them.

0 Kudos
Message 6 of 7
(4,024 Views)

I just do not understand why you need to remove a plot name, when you can just rename it. During runtime you can have full control on all strings, and also you can limit how many rows your Legend has. Why you need more actually?? The user cannot change the number of rows during runtime (your end-application should be always an EXE and not a VI), so why you care about the non-visible Legend entry names??

 

I do not think this is needed at all in your case, but there is another property, called "Legend: Plot minimum". This will limit the number of rows, and if you had plot names in the legend beyond the specified limit, it will indeed delete these names. But the result might look ugly, so you need to use this property alongside with the "LegNumRows" property node (or the MGI function which includes this property "Set Plot Legend Height?").

LegPlotMin.png

 

And I repeat again, you do not need to delete plot names, it just does not give you extra feature. You can limit the number of rows, and have full control on the strings. That is all you need...

Could you explain the actual reason why you need to delete Plot names?

0 Kudos
Message 7 of 7
(4,007 Views)