03-02-2017 03:38 AM
Can a master title be added to a waveform graph and xy graph programmatically? One which can be centered to the graph itself and which will export via the simplified image?
I've looked at using the caption, but cannot find a way to set its location programmatically. I've also mulled using an annotation, but those are relative to plot X and Y locations.
thanks,
XL600
Solved! Go to Solution.
03-02-2017 07:00 AM
Hi,
something like this seems to do the trick:
03-02-2017 07:14 AM - edited 03-02-2017 07:15 AM
How's this as a starting point? You need to "craft" the Graph manually, but then I think you'll be able to manipulate the text programmatically. Actually, you may even be able to create it programmatically (I haven't tried to do this yet, but all the pieces seem to be in place to allow this).
Here's what I did:
If you open a Property Node for the Graph and look at the Caption Property, it has a lot of things you can set, including Text, Text Color, etc. You can even set its location -- you'll need to "experiment" to see if this is relative to the Graph or relative to the Screen, but since you also have the Graph location/size, you should be able to position it as you wish. Note that I strongly urge you to bury the "ugly details" of such positioning code in a sub-VI, as it is likely to be messy and would detract from understanding the code involved in actually plotting your data ...
Bob Schor
03-02-2017 08:57 AM
@xl600 wrote:
I've also mulled using an annotation, but those are relative to plot X and Y locations.
thanks,
XL600
I wouldn't give up on that just yet Free annotations (annotation Mode 0) are relative to the scale not the plot so....
Seems to work. Some of those annotation properties really need to be played with to see how they interact (read that as once you actually play with them while decoding the help file for "Annotation List Property" hit this button:
And share what you learned with the rest of us
03-02-2017 10:03 AM
Well, I tried the caption approach and it kinda works. It's behavior with respect to autosizing the graph with the window is a little weird. The autosize doesn't appear to take into account the font size if it's changed programmatically (Probably has something to do with the vertical justification of the caption text). Also, if I change the font size of a multi-line caption programmatically, only the last line of the caption changes size (Really weird... Notice the "Waveform" text winds up different from the "Graph" text below).
Results in:
I should probably look into how to do my own autoscaling (Different topic).
It's be nice to be able to snap free labels to a graph/chart at arbitrary locations such that they would be embedded in graph image exports.
Thanks,
XL600
03-02-2017 11:07 AM
03-02-2017 11:09 AM
Properties that affect font, might only affect part of the text, depending on the selection settings.
03-02-2017 11:55 AM
Yep, that solved the size weirdness...
BTW: What I'm doing is providing a small,med, large button for a series of asynchronous pop-up graphs. For each graph size, I want to adjust fonts and whatever to make it look good when exported as simplified images. When the user changes sizes, all registered graph panels change size at the same time. I might add auto-tiling or cascading but each step in turn.... I'm happy at the moment that the graph data feeds to each pop-up independently and reliably via queues that the pop-ups create and pass back to the graph controller. This allows me to target additional plots to specific graphs as the user requests. The graphs are controlled via refs and command/status notifiers (Used like an ALL-GRAPH message passing mechanism).
Thanks!
XL600