11-28-2012 02:54 AM
Hi!
In the attacched picture there is a simple XY graph with legend; in the legend the index display is visible. I would like to read the index by a property node or something like that but I am not able to find the proper property node or a way to do that programmatically in my VI.
Any suggestion?
Thank you
Antonio
Solved! Go to Solution.
11-28-2012 03:20 AM
Hi Antonio,
Could you give me more detail about what do you want to do with the legend index display? Actually, legend is array of the name of the plot. So, if you want to get current active legend you can use Active Plot property. Or, if you want to get property from specific index, you can first set the index by Active Plot property. Then, you can use plot property to get property that you want.
11-28-2012 06:55 AM
Hi, Taov:
I will try to be more clear with an example. Let suppose the legend plot index has been set to "4". So in my application i want to read this number (e.g. "4") for some purposes. If I change the index number from front panel, somewhere in block diagram I need to read the new index number.
For arrays this function is performed by "IndexVals" property, but I am not able to find the same property for legend.
11-28-2012 09:46 PM
Hi Antonio,
I don't think that legend index display could used for such way, because the index display in legend is used to tell us which plot index the legend is, not as input. Maybe using an array / ring control that contain the plot name could help you achieve same result. Here I attached an example for you. Hope this help.
11-28-2012 11:54 PM
Hi
yes, your suggestion is a good reasonable solution.
Thank you
11-29-2012 12:12 AM
don't forget to mark my answer as solution
:smileywink
11-29-2012 05:31 PM
I can't find a clean way to access it.
However if you click on one of the plot names, you can trap that event, find the object with focus, and work you way up to the plot legend array.
See the attached VI.
05-06-2015 06:42 PM
Hi pcardnale,
how do you get plot legend reference?