Jump to content
Software FX Community

How to put Labels inside Y Axis


Recommended Posts

  • 2 weeks later...

As you advised, I tried to use annotation. But I am not able to provide exact top position for annotaion. Can you please advise some way to get accurate top position.

Actually I want to create a gantt chart with 2 bars for each items. My plan is to create 3 bars instead of 2 bars for each item. The value for 3rd bar would be zero and here I can provide annotation with lable text. But I am facing problem in positioning the annotation.

 Please Help

Link to comment
Share on other sites

The equivalent in ChartFX .NET 6.2 is ConstantLine. You can find a sample code in the Samples & Resource Center which is installed with your product; however, for your convenience, I am pasting the code snippet here:

SoftwareFX.ChartFX.Internet.Server.ConstantLine constantLine = chart1.ConstantLines[0];

constantLine.Value = 30;

constantLine.Color = System.Drawing.Color.Red;

constantLine.Axis = SoftwareFX.ChartFX.AxisItem.Y;

constantLine.Text = "Alarm Limit 1";

constantLine.Width = 1;

constantLine.Style = System.Drawing.Drawing2D.DashStyle.Dash;

constantLine = chart1.ConstantLines[1];

constantLine.Value = 3;

constantLine.Color = System.Drawing.Color.Orange;

constantLine.Axis = SoftwareFX.ChartFX.AxisItem.X;

constantLine.Text = "Limit 2";

constantLine.Width = 3;

chart1.Gallery =SoftwareFX.ChartFX.Gallery.Curve;

chart1.MarkerShape = SoftwareFX.ChartFX.MarkerShape.None;

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