We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export chart as an image

Thread ID:





118817 Apr 12,2015 07:21 AM UTC Apr 13,2015 08:55 AM UTC LightSwitch HTML 1
Tags: Chart
Asked On April 12, 2015 07:21 AM UTC

Saw that you could export the chart as an image in JS.
Is that possible in Lightswitch html?

If yes, do you have an example?


Praveen [Syncfusion]
Replied On April 13, 2015 08:55 AM UTC

Hi Sven,
Thanks for using Syncfusion product. We have analyzed this. Exporting a chart is possible in LightSwitch html. To export a chart, it should be rendered as HTML5 canvas element. This can be achieved by setting the below property in sample
enableCanvasRendering: true,

By default chart is rendered as SVG element. On specifying this property it is rendered as HTML5 canvas. Then this can be converted as an image and saved to disk locally by specifying the below code.
function download() { // triggered on clicking the export link/button
var canvas = $("#container").ejChart("exportChart"); // to get the chart rendered
var dt = canvas.toDataURL('image/png'); // to convert it as an image
this.rel='nofollow' href = dt.replace(/^data:image\/[^;]/, 'data:application/octet-stream'); // to download that image

We have also made a sample to illustrate this. Kindly find it from the below location.


And in addition exporting LightSwitch HTML chart is not possible in Internet Explorer browser. Because popup/client side downloading is blocked for security purpose in IE. So you have manually right click on the rendered chart and save it as image.

Please let us know if you have any concern.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon