Loading

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'
      	})
      }
          
  }
})
 
posted @ 2021-11-24 09:51  资深if-else侠  阅读(2380)  评论(0编辑  收藏  举报