RadChart Alternating Background StripLines On ASP Ajax control

Thread is closed for posting
2 posts, 1 answers
  1. Chris
    Chris avatar
    2 posts
    Member since:
    Jul 2012

    Posted 11 Jul 2012 Link to this post

    I want to show an alternating background colour for the X axis on a line chart on the ASP.Net Ajax RadChart control.
    I have found this article that shows the StripLine property for Silverlight and WPF chart control but I cannot find this property on the Ajax control. Maybe I'm just not finding it  - how can I set the background colour to stripe vertically in  line with the X axis columns.

  2. Answer
    Rosko avatar
    137 posts

    Posted 16 Jul 2012 Link to this post

    Hello Chris,

    I regreto to tell you that there is no out-of-the-box stripline feature in the ASP.NET RadChart. But I can offer you a workaround using marked zones. Please, refer to the code snippet below for further details. I hope this will help you achieve the desired results.

    public void GenerateStripLines(RadChart chart, int minValue, int maxValue, int step)
       for (int i = minValue; i <= maxValue + step; i+=step)
          Color zoneColor;
          if (i % 2 == 0)
             zoneColor = Color.White;
             zoneColor = Color.WhiteSmoke;
          var item = new ChartMarkedZone() { ValueStartY = i, ValueEndY = i + step };
          item.Appearance.FillStyle.MainColor = zoneColor;

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top