09-21-2011 06:29 PM
I am trying to use annotations to let the user build a ROI on a graph. Not having any events related to annotations does not help, but I can get around that using a Mouse Up event and sort through the different possibilities.
What I can't get around (apparently), is that when creating an annotation:
- the default is to have an arrow displayed next to it (even when the name is an empty string!)
- there appears to be no way to automatically name the newly created annotations (you would think that they would behave sinilarly to new cursors) with an incremented number (say "Vertex n", where n is incremented starting from 0).
Are these hidden features or features worth an idea suggestion?
LV 2011.
09-22-2011 06:50 PM
Hi X,
I believe that it is possible to do what you are trying to do, unless I am misunderstanding your problem.
Two sections under the LabVIEW 2011 help go into quite a bit of detail as to features that are possible:
"Adding Annotations to Graphs"
"Customizing Graphs and Charts" (specifically "Using Graph Annotations")
Let me know what you think or what needs clarification.
Kind Regards,
Nathan B
Applications Engineer
National Instruments
09-23-2011 12:12 PM
Nathan,
thanks for reading, but that was not my question. You can indeed programmatically change anything you want to annotations, but if the user creates a new annotation:
1) you are not informed of it (there is no event associated with annotation modification) so you have to get around that by monitoring mouse actions in the graph and sift through the events to isolate those which affected an annotation.
2) the style of the annotation (arrow, name, etc) is not customizable BEFOREHAND. You have to detect the annotation creation (see above), then adjust its style. This is actually a comment that holds for cursors too.
In my particular case, I am using annotations to allow the user to draw regions of interest on a graph, so I am really interested in just having points on the graph. I then draw a path connecting those points to generate the ROI contour. I don't need arrows and I would need to have each new annotation labeled with a single number (1, 2, etc...).
Of course I could hide the "Create Annotation" runtime menu and create my own to handle all this, but I think it would be nice to have this available by default...
My 2 cts,
X.
09-23-2011 12:22 PM
I prefer cursors for this particular operation, but this might get you started.
09-23-2011 12:24 PM - edited 09-23-2011 12:26 PM
I am using cursors to define hard min and max bounds, so that would not work for me... Bruce Ammons trick works fine too BTW.
04-28-2012 07:45 PM
Just as an update for future readers: I am now using the "PlotImages.Front" Property of the XYGraph to display my ROIs.Much easier...