相关疑难解决方法(0)

如何使用highcharts在服务器上保存图表的图像?

使用highcharts,您可以使用内置按钮下载当前图表(例如:http://www.highcharts.com/demo/ ,此按钮:箭头).您可以将其保存为PNG,JPEG,PDF或SVG.

我想要做的是创建一个链接,将图像保存在服务器上,而不是下载它.我怎么能这样做?

我想我必须修改exportChartexports.src.js文件中的函数.它看起来像这样(但我不知道javascript足以做到这一点):

exportChart: function (options, chartOptions) {
        var form,
            chart = this,
            svg = chart.getSVG(chartOptions);

        // merge the options
        options = merge(chart.options.exporting, options);

        // create the form
        form = createElement('form', {
            method: 'post',
            action: options.url
        }, {
            display: NONE
        }, doc.body);

        // add the values
        each(['filename', 'type', 'width', 'svg'], function (name) {
            createElement('input', {
                type: HIDDEN,
                name: name,
                value: {
                    filename: options.filename || 'chart',
                    type: options.type,
                    width: options.width,
                    svg: svg
                }[name] …
Run Code Online (Sandbox Code Playgroud)

javascript image highcharts

14
推荐指数
3
解决办法
5万
查看次数

标签 统计

highcharts ×1

image ×1

javascript ×1