How do I get y axis grid lines to show?
Works great. Thanks Max Rivlin!
I guess it would be nice to have the grid lines in the background by default. Maybe as an idear for the next version...
Looks like you're using a composite chart. Try doing this:
private void UltraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e){ IAdvanceAxis xAxis = (IAdvanceAxis)e.ChartCore.GetChartPrimitiveFromRowColumn(0, 0).Layer.Grid["X"]; foreach (Primitive p in e.SceneGraph) { Line gridline = p as Line; if (gridline != null && gridline.p1.X == xAxis.MapMinimum && gridline.p2.X == xAxis.MapMinimum && gridline.p1.Y < gridline.p2.Y) { gridline.Visible = false; } }}
Here I have a little different problem. I get gridlines, no problem, but I can’t get the z-order of the gridlines and the axis to work properly. The axis line is always “overwritten” by the gridline of the other axis. I have attached a little sample with modified colours and line thicknesses. I found out that it makes a difference in which order that I add the axis, but one axis is always "loosing". The problem is that I don’t want the gridline to appear in front (or even at all) of the axis line. Is there anything that I can do about it?
Y axis gridlines are visible by default for most chart types. What chart type are you using? If this doesn't work, please post a picture of your chart.
chart.Axis.Y.MajorGridLines.Visible = truechart.Axis.Y.MinorGridLines.Visible = true;