Hi,
I'm getting an error while I'm trying to download a image of my chart , this is my JS:
function download() {
var type = this.id;
type = "png"
var chart = $("#chartcontainer").ejChart("instance"),
exporting = chart.model.exportSettings,
data, type;
exporting.fileName = "img";
exporting.angle = 0;
exporting.type = type;
exporting.mode = "Client";
data = chart.export();
this.download = exporting.fileName + "." + type;
if (type == "png") this.rel='nofollow' href = data.toDataURL();
}
clientPng = document.getElementById('download');
if (clientPng.addEventListener)
clientPng.addEventListener('click', download, false);
else
clientPng.attachEvent('onclick', download, false);
And this is the error:
ej.web.all.min.js:10 Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap)'
Thank you.