echart自带工具
放大、下载、导出图片
toolbox: { // 工具箱
right: 20,
top: 10,
feature: { // 各个工具配置项
myTool1: {
show: true,
title: '放大',
icon: 'image://../../../../static/images/full_screen_blue.png',
onclick: () => {
this.fullShow = true
echarts.init(document.getElementById(this.fullId)).setOption(this.opt)
echarts.init(document.getElementById(this.fullId)).setOption({ // 隐藏放大按钮
toolbox: {
feature: {
myTool1: {
show: false
}
}
}
})
}
},
myTool2: {
show: true,
title: '导出表格',
icon: 'image://../../../../static/images/[email protected]',
onclick: () => {
downloadExl(this.exportData, '', 'xlsx_userAccessOne')
}
},
saveAsImage: {
title: '导出图片',
type: 'png',
excludeComponents: [ // 保存图表时忽略的工具组件,默认忽略工具栏
'toolbox'
],
icon: 'image://../../../../static/images/[email protected]'
}
}
}
axisTick: {show: false}, // 去掉x轴的刻度线
symbol: ‘circle’, // 拐点样式