To reproduce:
- Use HTML- like text formatting in the chart title.
- Export the chart to image.
- The tags are shown in the text.
Workaround:
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;
}