LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event for Annotation Creation?

What's the easiest way to detect when the user has created an annotation on a graph? For some reason, creating a free annotation drops the annotation out in space (out of view of the user). I'd like to detect when it gets dropped out there, and center it on the visible graph. Also, it would be nice to change the default color so it's visible on a white background.

Any thoughts? I suppose I could intercept the Create Annotation Shortcut menu selection, and replace the default dialog with my own, but it just seems like there may still be a way to use the built in stuff.

Thanks,
Chris
0 Kudos
Message 1 of 2
(2,707 Views)
Chris,
 
You could always keep track of the length of the Annotation List array and if it increases, then a new annotation has been made.  You can get the annotation list with a property node, so it would be relatively easy to keep track of.  There is a good example of adding the annotations programatically and it uses this annotation list array.  It is found in the LabVIEW examples if you search for annotation and is called "Programmatically Annotate A Graph".
 
This annotation list is an array of clusters where each cluster is a single annotation.  You can change the color of the annotation programmatically as well by manipulating this annotation list property of the graph.  I hope this helps.
Brian Coalson

Software Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,689 Views)