Remove alternance in chartarea background?

2 posts, 0 answers
  1. Enill
    Enill avatar
    41 posts
    Member since:
    Apr 2010

    Posted 30 May 2010 Link to this post

    Hi,
    is there a way to remove the "Default" rows color alternance in chartarea background? Currently the row alternate between white-gray-white-gray-etc...

    I would like to have this background in plain white but still keep the grid line.

    Also, how can i change the label color of a seriesmapping in doughnutseriesdefinition? I tried the code below but it doesnt work, the label text color stay white.

                        SeriesMapping smMats = new SeriesMapping() 
                        { 
                            SeriesDefinition = new DoughnutSeriesDefinition() 
                            { 
                                ShowItemLabels = true
                                ShowItemToolTips = true
                                RadiusFactor = 0.75, 
                                LabelSettings = new RadialLabelSettings() 
                                { 
                                    SpiderModeEnabled = true
                                    ShowConnectors = true 
                                } 
                            } 
                        }; 
                        smMats.ItemMappings.Add(new ItemMapping("AxisPointY", DataPointMember.YValue)); 
                        smMats.ItemMappings.Add(new ItemMapping("pointLabel", DataPointMember.Label)); 
                        smMats.ItemMappings.Add(new ItemMapping("pointToolTip", DataPointMember.Tooltip)); 
                        smMats.SeriesDefinition.Appearance.Foreground = new SolidColorBrush(labelForeColor); 
     
                        rc.SeriesMappings.Add(smMats); 


    Thanks in advance!
  2. Sia
    Admin
    Sia avatar
    755 posts

    Posted 02 Jun 2010 Link to this post

    Hello Jean-Philippe Savard,

    The Striplines in the RadChart control are visible by default but the Gridlines are hidden. You can show them as follows:
    //hides the striplines
    rc.DefaultView.ChartArea.AxisY.StripLinesVisibility = Visibility.Collapsed;
     
    //makes the gridlines visible
    rc.DefaultView.ChartArea.AxisY.MajorGridLinesVisibility = Visibility.Visible;
    rc.DefaultView.ChartArea.AxisY.MinorGridLinesVisibility = Visibility.Visible;

    The code above is for the gridlines and striplines which are related to the Y axis. The same properties are available for the X axis.

    If you need to change the Labels' foreground, you need to set:
    rc.DefaultSeriesDefinition.SeriesItemLabelStyle = this.Resources["CustomLabelStyle"] as Style;
    where you have to set your custom Style in your XAML:
    <Style TargetType="chart:SeriesItemLabel" x:Key="CustomLabelStyle">
            <Setter Property="Foreground" Value="Red" />
    </Style>

    If you want to change the background of the labels, please use the approach described in the "Styling RadChart for WPF and Silverlight gets easier" blog post. In order for that approach to work, you will need to download the latest available release of our controls.

    Regards,
    Sia
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top