Hi Mark,
The code for exporting the RadHtmlChart gets the values of the server-side width and height properties. That is why when you do not specify the server-side height property it has a default value of 0.
If you want, however, to get the actual dimensions(width and height) of the RadHtmlChart, then you can use the client-side methods - get_height and get_width to obtain them and then save these values in a hidden field, so that they can be available in the code behind as well. Please find below an example on how to do that:
ASPX:
JavaScript:
C#:
I have added a HiddenField in the markup and modified the JavaScript function getSvgContent and C# function Button1_Click from the VS example in the Exporting RadHtmlChart to PNG and PDF Code Library.
Kind regards,
Danail Vasilev
the Telerik team
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 their
blog feed now.