2011-11-15 2 views
3

차트 컨트롤에 일부 열과 GridLines가 있습니다. 차트의 특정 위치에 빨간색 StripLine을 추가하여 허용되는 수준 (또는 그 이상)을 표시하고자했습니다.Grid Chart를 통한 ASP.NET 차트 StripLine

격자 선이 그것을 감추고 있기 때문에 스트립 라인이 보이지 않는 것이 문제입니다! 스트립 라인은 그리드 라인만큼 1 포인트 너비입니다.

격자 선 위에 스트립 선을 그릴 수있는 방법이 있습니까?

감사 Y 축 5, 9.5의 위치에 스트립 라인을 볼 수있는 코드를 follwing을

+0

tablix 컨트롤을 사용하고 있는가? 그렇다면 최근에 비슷한 질문을 게시했습니다. http://stackoverflow.com/questions/8147492/ssrs2008-how-do-i-draw-a-stripline-over-the-top-of-chart-data – Codingo

답변

7

추가한다. 나는 그것이 효과가있을 것이라고 확신한다.

// 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);