How to save an image of the chart on the server with highcharts?

前端 未结 4 1972
一向
一向 2020-11-29 03:04

With highcharts, you have a built-in button to download the current chart (example: http://www.highcharts.com/demo/, this button:

4条回答
  •  清歌不尽
    2020-11-29 03:43

    You can try this

     var chart = $('#yourchart').highcharts();
        svg = chart.getSVG();   
        var base_image = new Image();
        svg = "data:image/svg+xml,"+svg;
        base_image.src = svg;
        $('#mock').attr('src', svg);
    

    Take html of Mock and send to DB or save only the binary code .

    Save highchart as binary image

提交回复
热议问题