import Highcharts from "highcharts";
import Highcharts from "highcharts/highstock"; //缩略轴
import stockInit from "highcharts/modules/stock";
//highcharts 导出功能模块文件
import loadExporting from "highcharts/modules/exporting.js";
stockInit(Highcharts);
loadExporting(Highcharts);
// 导出图表
exportChart() {
//文件名
const imgName = this.chartParam.subReport.name;
//导出时间
const time = new Date(+new Date() + 8 * 3600 * 1000)
.toISOString() //2021-10-19T10:20:07.880Z
.replace(/:/g, "")
.replace(/-/g, "")
.replace(/T/g, "_")
.replace(/\.[\d]{3}Z/, "");
this.chart &&
this.chart.exportChart({
type: "image/png",
filename: imgName + "_" + time
});
}
Vue中实现 highchart 图表的导出功能
最新推荐文章于 2022-09-06 14:18:05 发布