I am able to create an image from generated chart using the below method.But I want to save the same image to physical location of the server path.
Chart1.draw();
Chart1.toImage('pngimage', 'image/png');
Chart1.toImage('jpgimage', 'image/jpeg');
How I can save the same image to server/any physical location?
Save a chart to physical path
Re: Save a chart to physical path
Hello,
As far as I know the browser doesn't have direct access to filesystem. However, you can allow to download the png/jpg adding this to the javascript:
and this to the html section:
As far as I know the browser doesn't have direct access to filesystem. However, you can allow to download the png/jpg adding this to the javascript:
Code: Select all
var imageLink = document.getElementById('imageLink');
imageLink.href = Chart1.canvas.toDataURL('image/png');
Code: Select all
<a id="imageLink" download="myFilename.png">
Click to download
</a>
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |