【问题标题】:Highcharts: how to specify file name in window.location.href exporting image to local diskHighcharts:如何在window.location.href中指定文件名将图像导出到本地磁盘
【发布时间】:2015-12-08 13:11:41
【问题描述】:

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;

有什么想法吗?

【问题讨论】:

标签: javascript highcharts


【解决方案1】:

var image = Canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); window.location.href=图像; // 本地保存

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-12
    • 2012-01-12
    相关资源
    最近更新 更多