Chart strip lines

6 posts, 0 answers
  1. Anatoly Chekh
    Anatoly Chekh avatar
    86 posts
    Member since:
    Apr 2010

    Posted 24 Dec 2011 Link to this post

    Hello.

    I have a qustion:
    Is there a way to add strip lines to the axis?
    Can you give an example how to do this if its possible?

    Thanks, Anatoly Chekh.
  2. Sia
    Admin
    Sia avatar
    685 posts

    Posted 27 Dec 2011 Link to this post

    Hi Anatoly Chekh,

    The strip lines related to the Y axis are visible by default in RadChart. If you need alternating colors for the strip lines related to the X axis you need to:

    1. make them visible and set the needed styles:
      <chart:ChartArea.AxisX>
          <chart:AxisX StripLinesVisibility="Visible" >
              <chart:AxisX.AxisStyles>
                  <chart:AxisStyles StripLineStyle="{StaticResource CustomStripLine}" AlternateStripLineStyle="{StaticResource CustomAlternateStripLine}"/>
              </chart:AxisX.AxisStyles>
          </chart:AxisX>
      </chart:ChartArea.AxisX>
    2. define the needed styles in your resources:
      <Style x:Key="CustomStripLine" TargetType="Rectangle">
          <Setter Property="Fill" Value="#33000000" />
      </Style>
       
      <Style x:Key="CustomAlternateStripLine" TargetType="Rectangle">
          <Setter Property="Fill" Value="#66000000" />
      </Style>
    I hope this helps.

    Regards,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Anatoly Chekh
    Anatoly Chekh avatar
    86 posts
    Member since:
    Apr 2010

    Posted 27 Dec 2011 Link to this post

    Oh, Sorry.
    I mean another issue.
    I need to paint axis itself. Strip lines by default is painted only in plot area. But I need to paint them on the axis too (where labes are placed, between ticks).

    Thanks, Anatoly Chekh.
  4. Sia
    Admin
    Sia avatar
    685 posts

    Posted 29 Dec 2011 Link to this post

    Hello Anatoly,

    Can you please send us a picture showing the needed result?

    Thank you in advance.
    Kind regards,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  5. Anatoly Chekh
    Anatoly Chekh avatar
    86 posts
    Member since:
    Apr 2010

    Posted 29 Dec 2011 Link to this post

    Of course.

    Here it is: Chart
    X Axis is on teh top. And number on the top is axis labels. So I need to paint not only plot area but axis too.
  6. Sia
    Admin
    Sia avatar
    685 posts

    Posted 31 Dec 2011 Link to this post

    Hello Anatoly,

    Thank you for the clarification. Please have in mind that such customization is not supported by RadChart. Nevertheless I created a custom template for RadChart, where the needed is achieved by extracting the vertical strip lines' panel from the default clip panel where almost all elements are plotted by default.

    Please check the attached sample project. A  screenshot of the result is also attached.

    All the best,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top