LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

catching the label annotation clicked event

In a datalogging system i would to graph some plot (XY graph). For some of Xi point there will be other data to consider, so I used the annotation to that Xi point as referrer.
I would like to know if is it possible and how to catch the event related to the clicking of mouse over the label of a specific annotation and also have the value of the annotation selected.
With the XYgraph:mouse pressed I just have the event on the graph but no other indication.
Any solution for this?
 
 
Regards
0 Kudos
Message 1 of 4
(2,922 Views)
You can get events for dragging the annotation cursor (these show up as graph cursor events) but there are no events for annotation labels.  However, you should still be able to do this if you use some elbow-grease:  (1) Get a Mouse Down Event, (2) Check the AnnotiationList to get the position annotation labels and compare this to the Mouse Down Coordinates.  #2 is a little tricky because the label coordinates are relative to the annotation cursor (point) position, and also you do not know the rectange bounds of the annotation label.  However, you should be able to do a rough calculation of the label width using the number of characters in the annotation name (label).  Get out your duct-tape and make it happen Smiley Very Happy
0 Kudos
Message 2 of 4
(2,919 Views)
Thank you Jim. Your suggestion are really useful, but probably too much cpu consuming. On the other hand do you think that if i instead overimose something else this object can be catched?
0 Kudos
Message 3 of 4
(2,914 Views)
I don't think that there is any other solution that doesn't involve calculations as I have mentioned.  I don't think that this is computationally expensive -- computers are designed to do such tasks Smiley Wink
0 Kudos
Message 4 of 4
(2,904 Views)