图表上的带状线错误

Stripline error on chart

目前可以在图表上画条纹线,但是想在x/y轴的线上画时出现错误,画不出来

绘制带状线没有错误,没有弹出消息框,但仍然没有绘制。

        try
        {


            StripLine stripLine6 = new StripLine();
            stripLine6.StripWidth = 0;
            stripLine6.BorderColor = System.Drawing.Color.Green;
            stripLine6.BorderWidth = 4;
            stripLine6.BorderDashStyle = ChartDashStyle.DashDotDot;

            stripLine6.IntervalOffset = Convert.ToDouble(textBox12.Text);
            stripLine6.BackColor = System.Drawing.Color.Orange;
            stripLine6.Text = "x̅";
            chart2.ChartAreas[0].AxisY.StripLines.Add(stripLine6);
        }

        catch
        {
            MessageBox.Show("Error for Stripline 6 to be drawn");
        }

What I want

看起来像是

的组合
StripWidth = 0;

IntervalOffset = 0;

导致整条带状线根本不被绘制。

可能是一个错误,根据 MSDN:

StripLine.StripWidth Property

A setting of 0.0 will result in a line being drawn; this line will use the BorderColor, BorderDashStyle and BorderWidth property settings for its color, width and style. None of the Back* properties in this class are utilized when the value of StripWidth is 0.0.

要解决此问题,您可以将其中之一设置为正值:

StripWidth = 0.001;

IntervalOffset= 0.001;