Jump to content
Software FX Community

Attach method of annotation not working for line chart


Recommended Posts

When I use attach method and specify X and Y values for a line chart the annotation does not show up. However for certain chart types(like bubble, OpenHighLowClose e.t.c) this shows up.

If I specify left and Top for annotation in a Line chart, it shows up but getting the proper left and top positions are a problem. Also setting the left and top postion will not take care of setting the annotation to proper position in case the form is resized.

What is the way out for positioning annotation for line chart?

Link to comment
Share on other sites

Bar charts only support categorical X-Axis, so regardless of your X-Values, the attachment position must be expressed as an index in the X-Axis (0 for the first point, 1 for the second, etc.). In a line chart, the X-Axis is not categorical (if X-Values are passed) and therefore the attachment position is dependent on the X-Value and not on the point index.

ChartReport.Gallery = Gallery .Lines ;

Annotations annots = new Annotations ();


annots.EnableUI = true ;

annots.ToolBar.Visible = true ;

AnnotationText text = new AnnotationText ( "Katrina" );

text.Attach(2, 10);

text.Color = Color .LightBlue;

text.PlotAreaOnly = true ;

text.AllowMove = false ;



Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...