【问题标题】:HighCharts offline-exporting module not workingHighCharts 离线导出模块不工作
【发布时间】:2021-10-09 01:01:51
【问题描述】:

我在强制 highcharts 离线导出时遇到了问题。我添加了 offline-exporting.js 模块以及导出模块。我已将 fallbackToExportServer 设置为 false,但我仍然转到 highcharts 服务器 (https://export.highcharts.com/) 并收到此错误:13 Request Entity Too Large。

<script src="//code.highcharts.com/highcharts.js"></script>
<script src="//code.highcharts.com/modules/data.js"></script>
<script src="//code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>


exporting: {
      filename: title,
      fallbackToExportServer: false,

要查看问题,请转至:https://www.nrel.gov/transportation/drive-cycle-tool/

在 Drive Cycles 表中,搜索“Fleet DNA”。 点击“Fleet DNA Drayage Maximum Energy*” 向上滚动并单击图表下方的“下载行驶周期数据或图像”。 选择“下载JPEG图像”

一些数据集工作正常。

【问题讨论】:

    标签: highcharts


    【解决方案1】:

    它与此报告的问题有关: https://github.com/highcharts/highcharts/issues/4614

    作为一种解决方法,您可以设置一个增加大小限制的自定义导出服务器: https://www.highcharts.com/docs/export-module/setting-up-the-server

    【讨论】:

    【解决方案2】:

    几天前我注意到同样的问题,有点奇怪,尽管将标志设置为 false,但它正在调用 highchart 服务器以获取图表 pdf。

    然后我使用了highchart图表实例的exportChartLocal方法:

    chart.exportChartLocal({
         type: 'image/jpeg', // replace with image/jpeg
         filename: 'test.jpg',
         fallbackToExportServer: false,
         sourceWidth: 900,
         scale: 1,
    });
    

    看这个例子:https://jsfiddle.net/riteshwaghela/huw8e31z/7/

    【讨论】:

    • 我试过了,但无法让它工作。你在某个地方有一个可行的例子吗?
    • @sfjeld - 检查答案中的链接。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多