How to change Pie or Doughnut Chart Font Size!?

2 posts, 0 answers
  1. Minseok Bang
    Minseok Bang avatar
    19 posts
    Member since:
    Oct 2009

    Posted 19 Nov 2009 Link to this post

    I make Style
    <Style x:Key="DoughnutStyle1" TargetType="telerikCharting:Doughnut">
       <Setter Property="Foreground" Value="{StaticResource SeriesItemLabelForeground}"/>
       <Setter Property="FontSize" Value="{StaticResource SeriesItemLabelFontSize}"/> --> I want to change code like : Value="8"
       <Setter Property="Template">
         <ControlTemplate TargetType="telerikCharting:Doughnut">
            <ScaleTransform x:Name="PART_AnimationTransform" ScaleX="0" ScaleY="0"/>
           <Path x:Name="PART_DefiningGeometry" StrokeThickness="{StaticResource RadialItemStrokeThickness}"
                                      Style="{TemplateBinding ItemStyle}" Data="{TemplateBinding FigurePath2}"/>
           <Ellipse Fill="{StaticResource DoughnutMaskBrush}" Height="{TemplateBinding ItemActualHeight}"
                                         Width="{TemplateBinding ItemActualWidth}" Clip="{TemplateBinding FigurePath3}"/>
           <telerikCharting:SeriesItemLabel x:Name="PART_SeriesItemLabel"
                                                                 Style="{TemplateBinding SeriesItemLabelStyle}"
                                                                 Visibility="{TemplateBinding SeriesItemLabelVisibility}"
                                                                 Content="{TemplateBinding SeriesItemLabelText}"/>

    and Style apply to RadChart Like bellow
     <Grid x:Name="LayoutRoot">
                <telerikChart:RadChart x:Name="RadChart1"  Style="{StaticResource DoughnutStyle1}">

    I Have Question in here,
    implement above source code, error occured. because Style is not matched Radchart.
    So I change Code in xaml Like this

    <Grid x:Name="LayoutRoot">
                <telerikChart:RadChart  >
                   <telerikCharting:Doughnut x:Name="doChart" Style="{StaticResource DoughnutStyle1}"/>  -->
    this code Error too.

    So I had Changed Code
    <Grid x:Name="LayoutRoot">
               <telerikCharting:Doughnut x:Name="doChart" Style="{StaticResource DoughnutStyle1}"/>  
    Error Too.

    What Can I do?!
    Please Help T.T

    p.s I have Bug report.
    If Many LineSeries is on One Chart, All of Theme expcept Office_Black is not Show Line Series!!! TooltipChart Too.
    frankly speaking Office_Black Theme is not pretty. I want Windows7 Theme.

  2. Giuseppe
    Giuseppe avatar
    2363 posts

    Posted 25 Nov 2009 Link to this post

    Hello Minseok Bang,

    The easiest way to achieve the desired effect would be like this:

    <UserControl x:Class="SilverlightApplication1.MainPage"
        <Grid x:Name="LayoutRoot">
                <Style x:Name="CustomLabelStyle" TargetType="chart:SeriesItemLabel">
                    <Setter Property="FontSize" Value="30" />
            <control:RadChart x:Name="RadChart1" />

    RadChart1.DefaultSeriesDefinition = new PieSeriesDefinition() { SeriesItemLabelStyle = this.CustomLabelStyle };
    RadChart1.ItemsSource = new int[] { 1, 2, 3, 4 };

    As for the line series -- we are unable to reproduce the problem in our local tests. Make sure you have added reference to the Telerik.Windows.Themes.Windows7.dll in order to apply the theme correctly.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top