我可以 delete/hide 特定的图表网格线吗?

Can i delete/hide specific chart grid line?

我想delete/hide特定的ms图表网格线,可以吗?

这是一个用白色 RectangleAnnotation.

覆盖部分图表区域的示例

// a few references:
ChartArea ca = chart.ChartAreas[0];
Axis ax = ca.AxisX;
Axis ay = ca.AxisY;
// create an annotation
var ra = new RectangleAnnotation();
// by default anotations are positioned in percentages
// we associate it with axes to change positioning to axis values:
ra.AxisX = ax;
ra.AxisY = ay;
// our colors:
ra.LineColor = Color.White;
// for testing I use a semi-transparent color:
ra.BackColor = Color.FromArgb(222, Color.White);
// the values of the last point in my series:
double vxLast = chart.Series[0].Points.Last().XValue;
double vyLast = chart.Series[0].Points.Last().YValues[0];
// the top right of the chartarea:
double vxEnd = ax.Maximum;
double vyEnd = ay.Maximum;
// we position the annotation
ra.X = vxLast;
ra.Y = vyEnd;
// by default annotations are as large as we set them to be
// I cheat by clipping it to my chartarea:
ra.ClipToChartArea = ca.Name;
// now it is enough to make them really large:
ra.Width = 9999;
ra.Height = 9999;
// done. now we show it:
chart.Annotations.Add(ra);

当然你可以计算出准确的宽度和高度,如果你想..

注释应打印并保存、缩放等。