Jump to content
Software FX Community

Drawing a horizontal line with an AnnotationArrow?


korthmat

Recommended Posts

I'm currently using ChartFX 7, version 7.0.2281.32010.

I'm attempting to draw a short horizontal line segment with an AnnotationArrow object.  Using this code:

AnnotationArrow objectiveLine = new AnnotationArrow();

objectiveLine.AllowModify = false;

objectiveLine.AllowMove = false;

if (index != 3)

  objectiveLine.Border.Style = DashStyle.Dash;

objectiveLine.Border.Color = OBJECTIVE_LINE_COLOR;

objectiveLine.EndCap.Height = 0;

objectiveLine.EndCap.Width = 0;

objectiveLine.Height = 1;

objectiveLine.Width = (chart.ChartAreaRectangle.Width - chart.PlotAreaMargin.Left - chart.PlotAreaMargin.Right) / 4;

objectiveLine.Attach(index + 1, objective);

annots.List.Add(objectiveLine);

...I get the lines I need, but they're not quite horizontal.  Is there any way to get this to work?

Link to comment
Share on other sites

  • 3 weeks later...

Hi korthmat

Please try the following code:

AnnotationArrow arrow = new AnnotationArrow();arrow.Border.Color = Color.Red;arrow.Border.Width = 4;arrow.Color = Color.Red;arrow.Height = 0;arrow.Width = 100;arrow.Attach(2, 30);arrow.EndCap.Height = 1;arrow.EndCap.Width = 0;arrow.EndCap.Filled = false;

Carlos Chaves

 

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.

Guest
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...