ChartTitle background gradient

2 posts, 0 answers
  1. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 25 Jun 2010 Link to this post

    I need to reproduce the background (Service Category) that shows sample.jpg, by default is black but I need to use that background. Can I put an image as background? if not, Can I use gradient in the background chartTitle?
    Thank you.
  2. Sia
    Sia avatar
    667 posts

    Posted 28 Jun 2010 Link to this post

    Hello Chris Thierry,

    You can set whatever you want as ChartTitle's background.
    Just add the following style in your resources:
        <Style x:Key="TitleStyle" TargetType="charting:ChartTitle">
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="Background" Value="Red" />
            <Setter Property="BorderBrush" Value="#FFB5B5B5" />
            <Setter Property="OuterBorderBrush" Value="Black" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="OuterBorderThickness" Value="1" />
            <Setter Property="Padding" Value="7" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontSize" Value="11" />
            <Setter Property="FontWeight" Value="Bold" />
    and modify the background property. I am sending you all properties that can be set to something different.

    The default value for the ChartTitle's background in the "Office Black" theme is:
    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FF5B5B5B" Offset="1"/>
        <GradientStop Color="#FF868686"/>
        <GradientStop Color="#FF4F4F4F" Offset="0.42"/>
        <GradientStop Color="#FF0E0E0E" Offset="0.43"/>

    You need to set your custom style in your code-behind:
    RadChart1.DefaultView.ChartTitle.Content = "Service Category";
    RadChart1.DefaultView.ChartTitle.Style = this.Resources["TitleStyle"] as Style;

    I hope this helps.

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top