7 Answers, 1 is accepted
You may use new line to separate the text , i.e. have a subtitle. For example:
<
TextBlock
Text="This is first line.
This is on another line">
instead of this:
<
TextBlock
Text
=
"This will appear as a single line."
>
You can achieve this in code behind too:
this
.radChart1.ChartTitle.TextBlock.Text +=
"first line here"
+ System.Environment.NewLine +
"second line here"
;
To be able to have different styles applied to each line you can try something like this.
this
.radChart1.ChartTitle.TextBlock.Text =
"Main Title"
;
var titleStyleClone = (Telerik.Charting.Styles.StyleTextBlock)(
this
.radChart1.ChartTitle.TextBlock.Appearance.Clone());
TextBlock textBlockChartTitleSub =
new
TextBlock(titleStyleClone);
textBlockChartTitleSub.Parent =
this
.radChart1.ChartTitle;
textBlockChartTitleSub.Text =
"another chart title"
;
textBlockChartTitleSub.Appearance.TextProperties.Color = System.Drawing.Color.Blue;
textBlockChartTitleSub.Appearance.TextProperties.Font =
new
System.Drawing.Font(
"Verdana"
, 10);
textBlockChartTitleSub.Appearance.Position.Y += 30;
this
.radChart1.ChartTitle.Add(textBlockChartTitleSub);
Greetings,
Evgenia
the Telerik team

I tried your code above to have different styles applied for the 2nd line of the chart title but got an issue. The chart title is not big enough to hold both lines & thus, only the top half of 2nd line show up. Plz see my attached picture.
I tried many ways but cannot change the height of the chart title.
Can you advise me a solution for this? Many thanks.
You can control the size of the Title by turning off the AutoSize property and providing your own Height and Width properties. You will also need to provide bigger top Margin for the PlotArea so that the chart title won't be overlapped by the plot area:
this.RadChart1.ChartTitle.Appearance.Dimensions.AutoSize = false;
this.RadChart1.ChartTitle.Appearance.Dimensions.Height = 50;
this.RadChart1.ChartTitle.Appearance.Dimensions.Width = 170;
this.RadChart1.PlotArea.Appearance.Dimensions.Margins.Top = 70;
Regards,
Evgenia
the Telerik team

I'd really like this functionality. Is there a sample project somewhere?
Ken
Modifying the Appearance properties of the second TextBlock won't affect the original one, i.e. you can have different styles for them as shown in the code snippet of the previous post.
Regards,Evgenia
the Telerik team

Thanks for the reply.
I couldn't get that code to work. Could you put it into a sample project for download?
Thanks,
Ken
You may find a sample attached where this is demonstrated.
Kind regards,Evgenia
the Telerik team