我想用highcharts做离线导出。这是我的代码
import {Chart} from 'highcharts-vue'
import Highcharts from 'highcharts'
import offlineExporting from "highcharts/modules/offline-exporting"
offlineExporting(Highcharts)
我试着同时使用exporting.js和offline-exporting.js,并且成功了。这是问题的解决方案吗?如果不是,还有其他的解决方案吗?
3条答案
按热度按时间dluptydi1#
要使用
offline-exporting
模块,您还需要导入exporting
模块。此外,还可以禁用
fallbackToExportServer
属性,以便导出时永远不使用Highcharts导出服务器。美国石油学会:
回退到导出服务器:布尔值
如果脱机导出模块无法在客户端导出图表,是否回退到导出服务器。
...
现场演示:https://jsfiddle.net/BlackLabel/92dbwLgx/
API引用:https://api.highcharts.com/highcharts/exporting.fallbackToExportServer
文件:https://www.highcharts.com/docs/export-module/client-side-export
nzk0hqpo2#
您需要将“
exporting.fallbackToExportServer
”设置为等于“false
”,以便始终将图表导出到本地。http://jsfiddle.net/viethien/rcmpbsL1/
第一个
u4vypkhs3#
对于
offline-exporting
,您必须进行客户端导出实现此外,您必须添加导出对象为Highcharts选项