【问题标题】:How to change exporting filename in highcharts如何在highcharts中更改导出文件名
【发布时间】:2016-12-04 03:31:54
【问题描述】:

我想更改从 Highcharts 2.3.5 导出下载的文件的文件名,但我无法这样做。我试图改变它,但没有成功。 fiddle link

我尝试更改为 chart_new_name 但它只下载一个名为 chart.[required extension (png,jpeg,pdf,svg)] 的文件。

exportChart: function (a, b) {
        var c = this.options.exporting,
            d = this.getSVGSH(l(c.chartOptions, b)),
            a = l(c, a);
        e.post(a.url, {
            filename: a.filename || "chart"+_newname,
            type: a.type,
            width: a.width,
            scale: a.scale || 2,
            svg: d
        })

只下载chart.[png,jpg,pdf],但我需要它来下载chart_newname.[png,jpg,pdf]

【问题讨论】:

标签: javascript svg highcharts


【解决方案1】:

您应该为此使用exporting.filename 选项:

exporting: {
    filename: 'custom-file-name'
}

现场示例:jsFiddle

【讨论】:

    猜你喜欢
    • 2022-01-23
    • 1970-01-01
    • 2023-03-16
    • 1970-01-01
    • 2017-11-06
    • 2013-11-25
    • 2013-02-27
    • 1970-01-01
    • 2017-06-16
    相关资源
    最近更新 更多