I have an IgniteUI igDataChart that I would like to save to disk as an image. You cannot right click on the chart and save the image, because it uses several canvases. The chart does however have an export image method which will get the entire chart image and return it into a javascript variable.
I would like to automatically save this file to the user's download folder on a button click. If this were a server side image I could simply direct the user to the appropriate url, but it is not.
How can the user download this client side generated png image of the chart on a button click? I need a crossbrowser solution.
$(function () {
$("#exportBtn").click(function(){
//returns an image DOM element;
var pngImage = $("#chart").igDataChart("exportImage");
//now i need to download the image
});
});