使用外部按钮

时间:2017-10-04 22:38:15

标签: highcharts

In this Highcharts chart目标是使用图表外部的按钮离线导出。

我遇到的问题是,即使我将offline-exporting.js文件添加到我的应用程序中,如果我单击{{1时 <非> 连接到互联网我收到一条错误消息,说它无法访问网址Offline Export

如何解决此错误并导出离线?

HTML

export.highcharts.com

使用Javascript:

  <button id="exp" >Offline Export</button>
  <div id="container" style="height: 400px; width: 500px"></div>

1 个答案:

答案 0 :(得分:2)

尝试使用exportChartLocal()

   $( "#exp" ).click(function() {
    alert( "Handler for .click() called." );
    var chart = $('#container').highcharts();
        chart.exportChartLocal({
            type: 'image/png',
            filename: 'theimage'
        });
  });