3

I have a Chart control with some columns and GridLines. I wanted to add a red StripLine at a specific location on the Chart to show that this is the acceptable level (or whatever).

The problem is that the stripline is not showing because the gridlines are hiding it! the strip line is just 1 point width as so as the gridlines.

Is there a way that I can draw the strip line OVER the gridlines and not under it?

Thanks

Yousi
  • 795
  • 3
  • 9
  • 22
  • Is this using the tablix control? If so I posted a similar question recently, here: http://stackoverflow.com/questions/8147492/ssrs2008-how-do-i-draw-a-stripline-over-the-top-of-chart-data – Michael A Dec 27 '11 at 16:57

1 Answers1

7

Add follwing code to view strip line at 5 and 9.5 positions in y axis. I am sure it will work

    // 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);
Dafy Sequera
  • 86
  • 1
  • 2