VerticatGridLines color

2 posts, 0 answers
  1. Maxim
    Maxim avatar
    10 posts
    Member since:
    May 2009

    Posted 29 Jul 2009 Link to this post


    How can I change color of vertical and horizontal gridlines in chart?

    Thank You.
  2. Giuseppe
    Giuseppe avatar
    2363 posts

    Posted 31 Jul 2009 Link to this post

    Hi Maxim,

    You can achieve the desired effect like this:

    <UserControl x:Class="SilverlightApplication1.Page"  
        <Grid x:Name="LayoutRoot" Background="White"
                <Style x:Name="CustomGridLineStyle" TargetType="telerikCharting:GridLine2DBase" > 
                    <Setter Property="Stroke" Value="Yellow" /> 
            <telerik:RadChart x:Name="RadChart1" /> 

    RadChart1.DefaultView.ChartArea.AxisX.AxisStyles.GridLineStyle = this.CustomGridLineStyle; 
    RadChart1.DefaultView.ChartArea.AxisY.AxisStyles.GridLineStyle = this.CustomGridLineStyle; 
    RadChart1.DefaultView.ChartArea.AxisX.MajorGridLinesVisibility = Visibility.Visible; 
    RadChart1.DefaultView.ChartArea.AxisY.MajorGridLinesVisibility = Visibility.Visible; 
    RadChart1.ItemsSource = new[] {21, 14, 1, 44, 6, 21, 43, 1, 60}; 

    More information on axis styling can be found here.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top