From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
jj2

Higher level control of graph / plot legend needed to quickly/easily add legend text

Status: New

The current legend properties are too low level - requires a loop to iterate on active plot and set/get legend text.

There should be high level (express ?) VI's to do the most common task of labeling a plot legend.

Yes this can all be done with lower level primitives today but why waste everyone's time with coding something that is always needed.

Ideally an express VI that takes a reference to a plot and an array of numbers of strings and allows the user to generate an appropriate legend for the plot based on the array input. The express VI can be saved and modified by the user for special, uncommon applications but most users can just use express VI to quickly create legend for plots.

3 Comments
X.
Trusted Enthusiast
Trusted Enthusiast

Keep track of which plot you are last modifying. Set Active Plot &Plot.Name in one go:

 

Screen Shot 2016-08-18 at 18.12.51.png

 or Screen Shot 2016-08-18 at 18.15.44.png

 

I am not sure I see why an Express VI (of all things) is needed for that.

 

jj2
NI Employee (retired)

Labeling is not as simple as just a text array. It is usually a combination of prefix text, number-> string text,  suffix text such as Parameter 1 = 1.2 units, Parameter 2= 2.0 units etc. In other words some number to string conversion and hence the string formatting and hence the need for an express VI to interactively set the legend string  the way you want it from an array of numbers. Use case is you have an array of numbers that represents part of the legend text you want to display but there are additional steps for format conversion and adding prefix suffix etc that the express vi should perform .

 

X.
Trusted Enthusiast
Trusted Enthusiast

These details were not in the original post. I am not sure the second version you are describing would not be best handled by a subVI doing the formatting (that's what I do when I am looking for that kind of format). But honestly, you can't go very far this way, because the legend is limited in its flexibility/features (can't be rescaled or moved by the user at runtime, will truncate names without hint of what the full name is, etc). Anyway, I was just trying to clarify what you had in mind to help with you idea.