This is a migrated thread and some comments may be shown as answers.
VerticatGridLines color
1 Answer 17 Views
This is a migrated thread and some comments may be shown as answers.
Maxim
Top achievements
Rank 1
Maxim asked on 29 Jul 2009, 06:54 PM
Hello

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


Thank You.

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 31 Jul 2009, 07:49 AM
Hi Maxim,

You can achieve the desired effect like this:

<UserControl x:Class="SilverlightApplication1.Page"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"   
    xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
 
    <Grid x:Name="LayoutRoot" Background="White"
        <Grid.Resources> 
            <Style x:Name="CustomGridLineStyle" TargetType="telerikCharting:GridLine2DBase" > 
                <Setter Property="Stroke" Value="Yellow" /> 
            </Style> 
        </Grid.Resources> 
         
        <telerik:RadChart x:Name="RadChart1" /> 
    </Grid> 
</UserControl> 

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,
Manuel
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.
Tags
Chart
Asked by
Maxim
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or