anilgupt Posted November 15, 2007 Report Share Posted November 15, 2007 Hi, Can somebody tell me how to put Y Axis Labels inside Y Axis??? Regards, +Anil Quote Link to comment Share on other sites More sharing options...
maximop Posted November 16, 2007 Report Share Posted November 16, 2007 The labeling of the axis will depend on the scale that you are setting. If you have a y-axis from 0-100 with a step of 10, then labeling the axis can be done as follows: chart1.AxisY.Labels[0] = "Label 1"; chart1.AxisY.Labels[8] = "Label 2";chart1.AxisY.Labels[16] = "Label 3"; Quote Link to comment Share on other sites More sharing options...
anilgupt Posted November 16, 2007 Author Report Share Posted November 16, 2007 This is fine. Generally all lables comes just before Y Axis. But I want to display all labels after Y axis. SO It should be inside Y axis. Quote Link to comment Share on other sites More sharing options...
maximop Posted November 16, 2007 Report Share Posted November 16, 2007 You cannot move the axis label inside of the chart; you can, however, rotate them around their position. If you need labels inside the chart and along the axis, I recommend you use annotations for this. Quote Link to comment Share on other sites More sharing options...
anilgupt Posted November 26, 2007 Author Report Share Posted November 26, 2007 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 Quote Link to comment Share on other sites More sharing options...
Frank Posted November 26, 2007 Report Share Posted November 26, 2007 Another suggestion: Use Custom Gridlines. For example: CustomGridLine cg = new CustomGridLine(); cg.ShowLine = false; // No line, just textcg.Value = 90;cg.Text = "Label 90"; chart1.AxisY.CustomGridLines.Add(cg); Quote Link to comment Share on other sites More sharing options...
anilgupt Posted November 26, 2007 Author Report Share Posted November 26, 2007 Thanks frank for quick reply. Can you please advise under which component I can get Custom Gridlines? Quote Link to comment Share on other sites More sharing options...
anilgupt Posted November 26, 2007 Author Report Share Posted November 26, 2007 This is for your reference, I am working on ChartFx .NET 6.2 version using Visual Studio 2003. Quote Link to comment Share on other sites More sharing options...
maximop Posted November 28, 2007 Report Share Posted November 28, 2007 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; Quote Link to comment Share on other sites More sharing options...
anilgupt Posted November 29, 2007 Author Report Share Posted November 29, 2007 This trick could able to provide same layouts as my client wants Thanks everybody who helped me. 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.