This jsfiddle显示了如何将Highcharts图表导出到png文件,但是没有显示如何指定文件名。
像
这样的东西var image = canvas.toDataURL("image/png")
.replace("image/png", "image/octet-stream");
image.filename = "file.png"; <=== this doesn't work
// Save locally
window.location.href = image;
有什么想法吗?
答案 0 :(得分:0)
var image = Canvas.toDataURL(&#34; image / png&#34;)。replace(&#34; image / png&#34;,&#34; image / octet-stream&#34;); window.location.href =图像; //它会在本地保存