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'
})
}
}
})
标签:Rainfall,obj,name,selected,myChart,Evaporation,点击,图例,echarts 来源: https://www.cnblogs.com/whh666/p/15596803.html