Showing results for 
Search instead for 
Did you mean: 

Changing Annotation Line Width and Style Programmatically in XY graph

I have an XY graph that will continuously plot data. Users must be able to add Annotations to any point on the graph. I know to customize the annotation, we can just right-click the annotation and change any attribute of the annotation. The default line width of the annotation is a thin line and I want to change this to a thicker line. I want to change the default line width and style of the annotation so that the line width will be updated whenever the user adds a new annotation. But I do not know how to change the default annotation Line width. I looked at the Annotation list property node, but it does not have the option to change Line width and style. Is there a way I can change the default annotation line width and style?

0 Kudos
Message 1 of 2

I don't think you can do it directly, as you can see which properties are available.


One thing you can probably do is set the arrow to be hidden and draw it yourself. For this you would need to get the position and label offset of each annotation, use an invoke node on the graph to translate the XY values to pane coordinates and then probably get the draw area coordinates so you can offset it correctly, draw the lines using the picture control VIs and then write it to one of the picture plot properties.


You would also need to handle panning/zooming/updates (which would require you to redraw), which might be a pain, because I don't remember if you can get events for all of these. The easiest option might be to just redraw this every second or so.

Try to take over the world!
0 Kudos
Message 2 of 2