【问题标题】:ASP.NET Chart StripLine over the GridLineGridLine 上的 ASP.NET 图表 StripLine
【发布时间】:2011-12-29 05:27:56
【问题描述】:

我有一个带有一些列和网格线的图表控件。我想在图表上的特定位置添加一条红色的带状线,以表明这是可接受的水平(或其他)。

问题是带状线没有显示,因为网格线隐藏了它!带状线和网格线一样只有 1 磅宽。

有没有办法可以在网格线上方而不是下方绘制带状线?

谢谢

【问题讨论】:

标签: asp.net charts gridlines


【解决方案1】:

添加以下代码以查看 y 轴 5 和 9.5 位置的带状线。我相信它会起作用的

    // Instantiate new strip line
    StripLine stripLine1 = new StripLine();
    stripLine1.StripWidth = 0;
    stripLine1.BorderColor = System.Drawing.Color.RoyalBlue;
    stripLine1.BorderWidth = 3;
    stripLine1.Interval = 5;

    // Consider adding transparency so that the strip lines are lighter
    stripLine1.BackColor = System.Drawing.Color.RosyBrown;

    stripLine1.BackSecondaryColor = System.Drawing.Color.Purple;
    stripLine1.BackGradientStyle = GradientStyle.LeftRight;

    // Add the strip line to the chart
    Chartname.ChartAreas[0].AxisY.StripLines.Add(stripLine1);

    StripLine stripLine2 = new StripLine();
    stripLine2.StripWidth = 0;
    stripLine2.BorderColor = System.Drawing.Color.RoyalBlue;
    stripLine2.BorderWidth = 3;
    stripLine2.Interval = 9.5;

    // Consider adding transparency so that the strip lines are lighter
    stripLine2.BackColor = System.Drawing.Color.RosyBrown;

    stripLine2.BackSecondaryColor = System.Drawing.Color.Purple;
    stripLine2.BackGradientStyle = GradientStyle.LeftRight;

    // Add the strip line to the chart
    Chartname.ChartAreas[0].AxisY.StripLines.Add(stripLine2);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-02
    • 1970-01-01
    • 2022-10-04
    • 2019-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多