ranjan_rai Posted June 23, 2009 Report Share Posted June 23, 2009 I want to trap click event of annotation text. There is a mousedown/mouseup event for annotation list but that also gets for any mouse click on the chart and not necessarily on the annotation. I want to have similar functionality like google finance where I can click on a annotation on a chart and navigate to a relevant place showing me details about the annotation. Please share a sample code snippet if somebody has tried this kind of feature. Quote Link to comment Share on other sites More sharing options...
TatianaG Posted June 24, 2009 Report Share Posted June 24, 2009 You can use the URL property of the Annotation: Annotations annots = new Annotations(); Chart1.Extensions.Add(annots); AnnotationText text = new AnnotationText("My annotation"); text.Attach(2, 3);text.Color = Color.Red; text.PlotAreaOnly = true;text.AllowMove = false; text.Link.Url = "http://www.softwarefx.com";annots.List.Add(text); Quote Link to comment Share on other sites More sharing options...
ranjan_rai Posted June 25, 2009 Author Report Share Posted June 25, 2009 I am using a Winform application and want to open a different form or populate details about the selected annotation in a different control. Is there some property or event or workaround I can use for this scenario? Quote Link to comment Share on other sites More sharing options...
ranjan_rai Posted July 14, 2009 Author Report Share Posted July 14, 2009 Any update on this? Is there a way in Winform application to detect the annotation that is clicked? Quote Link to comment Share on other sites More sharing options...
RandyJ Posted July 28, 2009 Report Share Posted July 28, 2009 Hi,The annotation extension provides independent events including MouseDown, you must attach to these events in order to be notified when clicks are madein the annotation objects.For example, if you have:Annotations annots = new Annotations();chart1.Extensions.Add(annots); you can attach to the event by doing:annotX.MouseDown += new MouseEventHandler(AnnotationMouseDown);and then you need to define the corresponding event handler:private void AnnotationMouseDown (object sender, MouseEventArgs e){ // Your Mouse Down event code goes here. You can use the HitTest method to retrieve the object being hit.}Regards,RandyJ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.