Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 68906

align graph legends and get graph-only bounds

$
0
0

I often overlay graphs to accommodate legnthy legends or plot data otrerwise difficult to get onto a single graph. Today I wrote a VI to align plot legends, whose widths tend to change with the plot names (should I be annoyed by this?). In the process I remembered that getting a graph's bounds and position will include the entire area occupied by the plot and its legentd, scrollbar, and palettes. It's interesting to me that you can get the plot area and the size of each of these accoutrement independently, but there does not seem to be a native way to get just the graph's boundaries (annoyance level now orange). Couple that with incosistent usage of "bounds", "area", and "position" in object properties... well, here you can see that I've employed some simple conversion routines to handle this.

 

In the attached llb is a VI that gets the graph boundaries by first turning off the palettes, legends, and scrollbar (and restoring them afterward), and another that aligns the legends of any number of graphs, by reference, taking into account legend visibility.  Hopefully others will find these useful.


Viewing all articles
Browse latest Browse all 68906

Trending Articles