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

Multi-Line Title?

3 Answers 102 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 25 Mar 2009, 07:58 PM
Using the latest version of the controls.

Is there a way to create a multi-line title?

I've tried the following in the chart.PreRender event, but have not had success:

RadChart1.ChartTitle.TextBlock.Text = "Line1 " & System.Environment.NewLine & "Line2" 
and
RadChart1.ChartTitle.TextBlock.Text = "Line1  Line2" 
and
RadChart1.ChartTitle.TextBlock.Text = "Line1 <br/> Line2" 

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 26 Mar 2009, 08:43 AM
Hello Dean,

The first line of code you have provided is valid and works fine for me. Just one note -- can you confirm it is used in PreRender event handler and not in PrePaint? The PrePaint event is fired when the chart layout calculation has been already completed. That is -- the chart title size is calculated according to its current content, so changing it at this point will not be reflected. So you might experience this issue with PrePaint, but it should be fine in PreRender.

Best regards,
Ves
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Philip
Top achievements
Rank 1
answered on 26 Aug 2013, 06:15 PM
I seem to be having the same issue using the line below does absolutely nothing. It simply ignores the System.Environment.Newline
It is a straight cut and paste from the code above.

I have tried everything I can possibly find, and it simply ignores any attempt to return the line. 

Should it really be this difficult to just add a sub title????





 Protected Sub RadChart1_PreRender(sender As Object, e As System.EventArgs) Handles RadChart1.PreRender


        RadChart1.ChartTitle.TextBlock.Text = "Line1 " & System.Environment.NewLine & "Line2"
    End Sub
0
Ves
Telerik team
answered on 29 Aug 2013, 01:23 PM
Hi Philip,

It seems to work correctly on our end. Please, find attached a simple example along with the result. Can you provide us with with an example reproducing the problem? Thanks.

Best regards,
Ves
Telerik
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 the blog feed now.
Tags
Chart (Obsolete)
Asked by
Dean
Top achievements
Rank 1
Answers by
Ves
Telerik team
Philip
Top achievements
Rank 1
Share this question
or