Can't change report title font size

2 posts, 0 answers
  1. Terry
    Terry avatar
    157 posts
    Member since:
    Jul 2009

    Posted 01 Oct 2009 Link to this post

    Hi:

    My titles are getting truncated in charts, so I want to make the font size (11 by default on my system) smaller.  Neither of the following is working.  Am I using the wrong properties?

     

                RadChart1.DefaultView.ChartTitle.FontSize = 8.0;       // doesn't work  
                RadChart1.DefaultView.ChartTitle.FontStretch = FontStretches.Condensed;     // doesn't work  
                RadChart1.DefaultView.ChartTitle.Content = "Non-Responses by Payer " + startDate.ToShortDateString()  
                    + " - " + endDate.ToShortDateString();  
     

    Thanks,


    Terry

     

  2. Velin
    Admin
    Velin avatar
    391 posts

    Posted 06 Oct 2009 Link to this post

    Hi Terry,

    Unfortunately, with the current version of the control the FontSize property of the ChartTitle is not template bound, so setting this property to a value does not change anything. This is about to be fixed in the next version of the control.

    In the meanwhile, we can recommend you to use the following code:
    xmlns:chart="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting" 
     
    <Style x:Name="ChartTitleStyle" TargetType="chart:ChartTitle"
                    <Setter Property="FontSize" Value="8"/> 
                    <Setter Property="Template" > 
                        <Setter.Value> 
                            <ControlTemplate TargetType="chart:ChartTitle"
                                <Border  Background="{TemplateBinding Background}" 
                                 BorderBrush="{TemplateBinding BorderBrush}" 
                                 BorderThickness="{TemplateBinding BorderThickness}"
                                    <Grid> 
                                        <ContentControl 
                                HorizontalAlignment="{TemplateBinding HorizontalAlignment}" 
                                VerticalAlignment="{TemplateBinding VerticalAlignment}" 
                                Content="{TemplateBinding Content}" 
                                Margin="{TemplateBinding Padding}" 
                                Foreground="{TemplateBinding Foreground}" 
                                FontSize="{TemplateBinding FontSize}" 
                                FontStyle="{TemplateBinding FontStyle}"   
                                FontWeight="{TemplateBinding FontWeight}" 
                                FontFamily="{TemplateBinding FontFamily}" /> 
                                    </Grid> 
                                </Border> 
                            </ControlTemplate> 
                        </Setter.Value> 
                    </Setter> 
                </Style> 
     
     
     RadChart1.TitleStyle = this.ChartTitleStyle; 


    All the best,
    Velin
    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