samiam1029 Posted November 14, 2009 Report Share Posted November 14, 2009 AxesStyle.Math helped me to get rid of top and right borders. However, I need to remove the left border as well. Sample chart is attached. Any help would be greatly appreciated. Thanks! Quote Link to comment Share on other sites More sharing options...
juanZ Posted November 17, 2009 Report Share Posted November 17, 2009 Hi, if there is no Y axis ploted on the chart, you cannot put a line on the base. I tried to imitate the chart proposed. Please check the code snippet below. Copy this in the load method of your application. Let me know if this works for you. chart1.Gallery = Gallery.Gantt; chart1.Data.Series = 2; chart1.Data.Points = 3; chart1.Data[0, 0] = 10; chart1.Data[0, 1] = 20; chart1.Data[0, 2] = 30; chart1.Data[1, 0] = -10; chart1.Data[1, 1] = -20; chart1.Data[1, 2] = -30; chart1.LegendBox.Visible = false; chart1.AllSeries.PointLabels.Visible = true; chart1.AxesStyle = AxesStyle.None; CustomGridLine cg = new CustomGridLine(0,string.Empty); cg.Color = Color.Gray; cg.Width = 1; chart1.AxisY.CustomGridLines.Add(cg); chart1.AxisY.Step = 5; chart1.AxisY.Grids.Major.Visible = false; chart1.AxisY.Grids.Minor.Visible = false; chart1.AxisX.Grids.Major.Visible = false; chart1.AxisX.Grids.Minor.Visible = true; Pane pane = new Pane(); chart1.Panes.Add(pane); pane.Separation = 0; chart1.Series[1].Pane = pane; pane.AxisY.Grids.Major.Visible = false; pane.AxisY.Grids.Minor.Visible = false; pane.AxisY.Step = 5; chart1.AxisX.Style |= AxisStyles.HideText; chart1.AxisY.Line.Style = System.Drawing.Drawing2D.DashStyle.Solid; chart1.AxisY.Line.Width = 2; chart1.AxisY.Line.Color = Color.Gray; Quote Link to comment Share on other sites More sharing options...
samiam1029 Posted November 18, 2009 Author Report Share Posted November 18, 2009 Hi, The code snippet you provided produces the attached chart. As you can see, the chart is missing the BASELINE. In fact, I think that, without even adding a new pane as in your code, simply setting AxesStyle.None produces the same result as your code does. This has to be possible since the desrired chart I posted in the beginning was done by previous version of ChartFX. I think we are missing a few properties here and there. Please continue to help me out here. I appreciate your help. Thanks. Sam Quote Link to comment Share on other sites More sharing options...
juanZ Posted November 19, 2009 Report Share Posted November 19, 2009 Hi Sam, The only way you can make the line on the bottom to be plotted is by showing up the Y Axis. If there is no Y Axis, the chart will not plot the axis X line. Quote Link to comment Share on other sites More sharing options...
samiam1029 Posted November 19, 2009 Author Report Share Posted November 19, 2009 Yes, but your code example does seem to have Y-axis yet your code snippet did not produce the bottom horizontal line I'm looking for! Let's just focus on your code example and try to get it fixed. Again, I need to see a visible horizontal line on the Y-axis, not just the step values. Quote Link to comment Share on other sites More sharing options...
juanZ Posted November 20, 2009 Report Share Posted November 20, 2009 Hi Sam, This is what is happening: the chart type is Gantt, so the Axis Y change position with Axis X in order to move the bars horizontally. This means the the zero position of X axis belongs to the first bar. If you want to put for example a custom gridline to zero position on Axis X, this will put it on top of the bar. So custom gridlines will not solve the issue. Then, In Chart FX 7, you cannot draw lines if there is no axis showed on the chart. So in your case, you need that the X axis is not showed, so no lines could be draw. What i think that might help you is to use an annotation object, but this is a work around. Yo have to calculate the px coordinates of the position Y axis in order to draw and annotation line there. I apologize for the inconvenient since this is a chart limitation. Quote Link to comment Share on other sites More sharing options...
Frank Posted November 23, 2009 Report Share Posted November 23, 2009 Another (easier) way to achive this is by adding a custom gridline at X = 0.5 whcih corresponds to the intersection of the X and Y axes: chart1.AxisX.CustomGridLines.Add(new CustomGridLine(0.5,null)); 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.