Multi-line chart title where each line has different formatting

2 posts, 0 answers
  1. Tony
    Tony avatar
    21 posts
    Member since:
    Oct 2011

    Posted 07 Jun 2012 Link to this post


    I want to have a 2 line title for my chart where each line has different formatting.  To illustrate:

    Chart Title Line 1 (Bold and Font Size 16)
    Chart Title Line 2 (Normal and Font Size 12)

    Is this possible in the Silverlight RadChart control and if so, how do I go about doing this.


  2. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 12 Jun 2012 Link to this post

    Hi Tony,

    You can achieve this by modifying the ControlTemplate of your ChartTitle. Here you can find the the style of the ChartTitle. I suggest that you modify the ControlTemplate like this:

    <Style x:Key="ChartTitleStyle" TargetType="telerik:ChartTitle">
        <Setter Property="Template">
                <ControlTemplate TargetType="telerik:ChartTitle">
                    <Border BorderBrush="{TemplateBinding OuterBorderBrush}"
                    BorderThickness="{TemplateBinding OuterBorderThickness}">
                        <Border Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        CornerRadius="{TemplateBinding CornerRadius}">
                                <ContentControl FontFamily="{TemplateBinding FontFamily}"
                                    FontSize="{TemplateBinding FontSize}"
                                    FontStyle="{TemplateBinding FontStyle}"
                                    FontWeight="{TemplateBinding FontWeight}"
                                    Foreground="{TemplateBinding Foreground}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    Margin="{TemplateBinding Padding}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                    Content="{TemplateBinding Content}" />
                                <TextBlock Text="{Binding}"

    After you finish the style, set the ChartTitle to use it, and then set the bindings:

    <telerik:RadChart x:Name="chart">
                      DataContext="My second chart title"
                      Content="First Title"
                      Style="{StaticResource ChartTitleStyle}"/>                       

    Kind regards, Petar Kirov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top