Way to Export Chart Image in IE

Hello, I know that IE does not support exporting image from chart due to security reasons. but can you help me on how can I do this? if there is a way I'd really appreciate it. Thank you!

1 Reply

BP Baby Palanidurai Syncfusion Team July 13, 2018 12:39 PM UTC

Hi Robin, 

  Thanks for using Syncfusion product. 

      Due to some security reason, IE doesn’t support exporting, as a work around, we can convert the SVG chart to canvas using canvg support and then we can download the canvas image. Please find the code snippet below to convert the svg to canvas and downloading the canvas image. 

Script: 

<script type="text/javascript" src="http://canvg.github.io/canvg/rgbcolor.js"></script>  
<script type="text/javascript" src="http://canvg.github.io/canvg/StackBlur.js"></script> 
<script type="text/javascript" src="http://canvg.github.io/canvg/canvg.js"></script> 


<div id="container"></div>           
                     <canvas id="canvas2" style="display:none"></canvas> 

   
var canvas = document.getElementById('canvas2');           
            svg = $("#container").html(); 
            canvg(canvas, svg);         
            var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");    
            var downloadLink = document.createElement("a"); 
           downloadLink.rel='nofollow' href = image; 
           downloadLink.download = "Chart.png"; 
           document.body.appendChild(downloadLink); 
         downloadLink.click(); 
           document.body.removeChild(downloadLink); 
           $('#canvas2').hide(); 

Please revert us, if you have any queries. 

Regards, 
Baby. 


Loader.
Up arrow icon