This is a migrated thread and some comments may be shown as answers.
Subtitles?
5 Answers 10 Views
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 22 Mar 2016, 11:14 PM
I looked around through the forums and documentation but could not find anything... is there a way to set a subtitle of the chart, that is one a different line with the main title, that uses a different font and/or color?

5 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 23 Mar 2016, 01:48 PM
Hello Steve,

Thank you for writing.

You can use the HTML-like Text Formatting to set the chart title. 

Let me know if you have additional questions.

Regards,
Dimitar
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Steve
Top achievements
Rank 1
answered on 23 Mar 2016, 07:03 PM

Awkward, but it works, thanks.

btw, the link is bad.

0
Dimitar
Telerik team
answered on 24 Mar 2016, 08:36 AM
Hi Steve,

Here is the correct link: HTML-like Text Formatting.

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Steve
Top achievements
Rank 1
answered on 24 Mar 2016, 10:13 PM
Unfortunately I encountered a problem with this solution. It looks fine on the screen but when I call ExportToImage, it renders the HTML code to the image. The attached file cdf-screenshot is how it looks on the screen and the file cdf-exporttoimage is how it looks after calling ExportToImage
0
Dimitar
Telerik team
answered on 25 Mar 2016, 09:18 AM
Hello Steve,

Thank you for writing back.

This is considered an issue and I have logged it in our Feedback Portal. It is caused because the text is not painted with the correct method. You can track the item for status changes and add your vote for it here.

To workaround this you can manually paint the text:
private void radButton1_Click(object sender, EventArgs e)
{
    radChartView1.ShowTitle = false;
 
    TextPrimitiveHtmlImpl impl = new TextPrimitiveHtmlImpl();
    TextParams textParams = this.radChartView1.ChartElement.TitleElement.TextParams;
    SizeF size = impl.MeasureOverride(new SizeF(500f, 200), textParams);
 
    using (MemoryStream stream = new MemoryStream())
    {
        radChartView1.ExportToImage(stream, new Size(500, 500 - (int)size.Height));
 
        Bitmap bmp = new Bitmap(500, 500);
 
        using (Graphics g = Graphics.FromImage(bmp))
        {
            g.Clear(Color.White);
            textParams.paintingRectangle = new RectangleF(Point.Empty, size);
            impl.PaintPrimitive(new RadGdiGraphics(g), textParams);
            g.DrawImage(Image.FromStream(stream), 0, size.Height, 500, 500 - size.Height);
        }
 
        bmp.Save(@"D:\xfile.bmp");
    }
 
    radChartView1.ShowTitle = true;
}

Your Telerik Points have been updated for this report.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Asked by
Steve
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Steve
Top achievements
Rank 1
Share this question
or