echarts图例点击事件

myChart.on('legendselectchanged',(obj) => {
if(obj.name == 'Rainfall') {
if(obj.selected.Rainfall == false) {
myChart.dispatchAction({
type:'legendSelect',
name:'Rainfall'
})
}
}else if(obj.name == 'Evaporation') {
if(obj.selected.Evaporation == false) {
myChart.dispatchAction({
type:'legendSelect',
name:'Evaporation'
})
}

}
})

上一篇:Echarts 使用教程


下一篇:vue引用echarts