This is a migrated thread and some comments may be shown as answers.

Chart strip lines

5 Answers 48 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Anatoly Chekh
Top achievements
Rank 1
Anatoly Chekh asked on 24 Dec 2011, 06:33 PM
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.

5 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 27 Dec 2011, 10:29 AM
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 >>

0
Anatoly Chekh
Top achievements
Rank 1
answered on 27 Dec 2011, 11:51 AM
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.
0
Sia
Telerik team
answered on 29 Dec 2011, 11:11 AM
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 >>

0
Anatoly Chekh
Top achievements
Rank 1
answered on 29 Dec 2011, 11:55 AM
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.
0
Sia
Telerik team
answered on 31 Dec 2011, 10:12 AM
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 >>

Tags
Chart
Asked by
Anatoly Chekh
Top achievements
Rank 1
Answers by
Sia
Telerik team
Anatoly Chekh
Top achievements
Rank 1
Share this question
or