I'm exporting a chart to png using ExportToImage and the PngBitmapEncoder. Is there any way of getting rid of the border around the resulting image?
2 Answers, 1 is accepted
answered on 03 May 2011, 08:33 AM
I made a local test in order to reproduce this issue, but I didn't get an unexpected border around the chart. If you mean the default RadChart border, you can remove it before exporting and restore it after that. For example:
//restore the default RadChart border after export
radChart.BorderThickness = newThickness(1);
I hope this helps.
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
That did help. I did some more experimenting, and found that the problem only occurred when I set the width of the chart, which is strange because that is the constraining proportion for the area I'm putting the image of the chart in. So instead, I calculate the height I think I need, set that, and let width go unassigned.