Using version 2.0.2.0 of the Rad Ajax Chart.
I cannot figure out how to change the font size for the title of a chart created via the API.
The title is being truncated (it looks like part of a left parenthesis followed by "Enrollmen" and then a few extra pixels of something).
AutoTextWrap is True.
I'd expect to find the font-size property somewhere in the Appearance.TextProperties hierarchy, but don't see it.
Dim CTitle As New Telerik.Charting.ChartTitle
With CTitle.TextBlock
.Text =
"Enrollment Blah Blah"
.Appearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True
.Appearance.TextProperties.Color = System.Drawing.Color.Maroon
End With
RadChart1.ChartTitle.Add(CTitle)
7 Answers, 1 is accepted
0
Hi Tim Romano,
In order to change the font-size of the Chart Title you can use CharTitle element
(Text Block->Appearance->TextProperties->Font) from the property grid.
Here is an example:
I hope this information helps. I will be glad to assist you further
Regards,
Dessy
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
In order to change the font-size of the Chart Title you can use CharTitle element
(Text Block->Appearance->TextProperties->Font) from the property grid.
Here is an example:
<ChartTitle> |
<TextBlock Text=" Chart"> |
<Appearance TextProperties-Font="Verdana, 10pt"> |
</Appearance> |
</TextBlock> |
</ChartTitle> |
I hope this information helps. I will be glad to assist you further
Regards,
Dessy
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Tim R
Top achievements
Rank 1
answered on 17 Mar 2009, 02:33 PM
Does the API support the following approaches? (I'm not on-site to test it). Or must the font-name be specified (i.e. not font-family and not the CSS "inherit" directive) and does the size have to be specified in pt units?
ChartTitle.Appearance.TextProperties.Font = "medium"
ChartTitle.Appearance.TextProperties.Font = "sans-serif, small"
ChartTitle.Appearance.TextProperties.Font = "inherit, small"
Thanks
ChartTitle.Appearance.TextProperties.Font = "medium"
ChartTitle.Appearance.TextProperties.Font = "sans-serif, small"
ChartTitle.Appearance.TextProperties.Font = "inherit, small"
Thanks
0
Hello Tim Romano,
RadChart is just an image, rendered on the server, so CSS-like approach will not be applicable as there is no actual text in the browser. You will need to supply the desired font using a System.Drawing.Font object. Here is an example:
Regards,
Dessy
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
RadChart is just an image, rendered on the server, so CSS-like approach will not be applicable as there is no actual text in the browser. You will need to supply the desired font using a System.Drawing.Font object. Here is an example:
RadChart1.ChartTitle.TextBlock.Appearance.TextProperties.Font = New System.Drawing.Font(FontFamily.GenericSansSerif, 26) |
Regards,
Dessy
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mohammed
Top achievements
Rank 1
answered on 14 Feb 2011, 12:32 PM
I'm facing the same problem, I have tried every single line of code, it is not working. The font remains" Verdana, 15Pt"
any help please.
any help please.
0
Hi Mohammed,
To be able to change the Font Style and Size of the RadChart's Title you can set it by using the Properties window of the Visual Studio or manually in the markup:
Regards,
Evgenia
the Telerik team
To be able to change the Font Style and Size of the RadChart's Title you can set it by using the Properties window of the Visual Studio or manually in the markup:
<
ChartTitle
>
<
TextBlock
>
<
Appearance
TextProperties-Font
=
"Monotype Corsiva, 18pt, style=Italic"
>
</
Appearance
>
</
TextBlock
>
</
ChartTitle
>
Regards,
Evgenia
the Telerik team
0
Abhishek
Top achievements
Rank 1
answered on 18 Oct 2011, 04:11 PM
Hi,
Can you please provide a tested sample of code to change the Font size of the chart title from code behind.
I have tested all the solutions provided above but nothing is working.
Thanks in advance
Abhi
Can you please provide a tested sample of code to change the Font size of the chart title from code behind.
I have tested all the solutions provided above but nothing is working.
Thanks in advance
Abhi
0
Hello Abhishek,
Just add these code lines in your Page_Load body:
Kind regards,
Evgenia
the Telerik team
Just add these code lines in your Page_Load body:
MilestoneChart.ChartTitle.TextBlock.Text = "My Chart Title";
MilestoneChart.ChartTitle.TextBlock.Appearance.TextProperties.Font = new Font(new FontFamily("Monotype Corsiva"),18f, FontStyle.Italic);
Kind regards,
Evgenia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now