I want to create image of div contains bar, line, pie.
I am using following example and want to take image of container class.
I am using html2canvas to implement it. following is the piece of code :
$("#btnSave").click(function() {
html2canvas($(".container"), {
useCORS: true,
// allowTaint:true,
onrendered: function(canvas) {
theCanvas = canvas;
document.body.appendChild(canvas);
// Convert and download as image
Canvas2Image.saveAsPNG(canvas);
$("#img-out").append(canvas);
// Clean up
//document.body.removeChild(canvas);
}
});
});
It's not working :(
Any idea how to implement it?
Any help is appreciated. I am really stuck this point.