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

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to read the size of a Graph window

Solved!
Go to solution

I'd like to use the size of the graph window to position the legend next to it, but can't find the right property. "Bounds - Area Width" appears to include the entire control (Blue arrows in image below) including the legend, while "Plot - Area - Size" seems to be just the grid area (the yellow arrows). What I want to know is the size of the box that includes the plot plus the axis labels (the red arrows). Anybody know what properties would get me that information?

 

GraphSize.png

 

0 Kudos
Message 1 of 5
(2,304 Views)
Solution
Accepted by topic author cabele

Easiest way is a few steps. 

 

1. Set the legend visible property to false.

2. Get the bounds

3. Set the legend back to visible, and move as you want.

 

Message 2 of 5
(2,295 Views)

It's rather awkward (need to add a sequance to hide the legend and show it again),  but does work. Why couldn't they have just made those values available?

 

Thanks

 

0 Kudos
Message 3 of 5
(2,288 Views)

Not sure why they have it that way.


FYI you can do it all in one property node if you want.  Expand the node down to get more properties in one node (3 for your case).  They execute top down and you can right click on each to set it to read or write.

F -> Legend Visisble

Bounds ->

T -> Legend Visible

0 Kudos
Message 4 of 5
(2,286 Views)

Learn something every day: I didn't realize that the properties were evaluated top down. And it also forced me to realize that that individual properties could be set to "read" or "write", they don't all have to be the same direction.

 

On the other hand this didn't work the way I was thinking either.  I need to have some properties affect others, and Labview refuses to do that without adding feedback nodes. That implies at least two iterations of property referrence, which gets me back to a sequence again.

 

But thanks for taking the time to add a follow up message, I did learn some useful things from it.

0 Kudos
Message 5 of 5
(2,275 Views)