LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graph legend properties

Solved!
Go to solution

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

0 Kudos
Message 1 of 8
(2,898 Views)

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.

 

0 Kudos
Message 2 of 8
(2,889 Views)

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.

0 Kudos
Message 3 of 8
(2,871 Views)
Solution
Accepted by topic author Yixiao-uncle

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.

0 Kudos
Message 4 of 8
(2,861 Views)

Hi

yes, your suggestion is a good reasonable solution.

Thank you

0 Kudos
Message 5 of 8
(2,849 Views)

don't forget to mark my answer as solution

:smileywink

 

0 Kudos
Message 6 of 8
(2,841 Views)

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.

0 Kudos
Message 7 of 8
(2,813 Views)

Hi pcardnale,

how do you get plot legend reference?

0 Kudos
Message 8 of 8
(2,652 Views)