This is a migrated thread and some comments may be shown as answers.

Can't change report title font size

1 Answer 58 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Terry
Top achievements
Rank 1
Terry asked on 01 Oct 2009, 07:30 PM
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

 

1 Answer, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 06 Oct 2009, 11:06 AM
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.
Tags
Chart
Asked by
Terry
Top achievements
Rank 1
Answers by
Velin
Telerik team
Share this question
or