Sign in to follow this  
scorbett

Modify Chart Width/height On Export?

Recommended Posts

Is it possible to modify the chart width/height when exporting? We currently use the server-side export to capture an image of the chart, but because we allow the chart to stretch if necessary to fill whatever size our main window is, the resulting exported chart image's aspect ratio is unpredictable. It would be nice if we could pass in a width/height as export configuration parameters so that the generated image has a predictable size and aspect ratio. It seems that fusioncharts will export the chart image at whatever size the chart was rendered at, so the only workaround I can think of is that when the user hits the "export" button, we could re-render the chart at a predetermined width/height into a hidden div, and then export that chart instead of the displayed one (which might be at any width/height depending on how the user has stretched the main window). Unfortunately, my workaround causes us to lose the nice "capturing data..." progress bar that fusion charts shows us (and it's also much slower). Is there a better solution?

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

Thanks for your post.

First of all, you would need to clone the chart and render it in some hidden area with the renderAt attribute and width and height as per your requirement.

ref: http://www.fusioncha...I/Overview.html

Then, you would need to catch the rendered event of that hidden chart and call export function to re-render the chart.

ref: http://www.fusioncha...API/Events.html

But, please make sure that the hidden area is atleast 1/2 pixels visible else the chart will not render.

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this