echart默认点击legend时候,当前点击的legend会置灰,有两种方式不置灰
1.设置selectedMode: false,这种方法控制不能点击legend
legend: {
orient: 'vertical',
x:'center',
y:'center',
textStyle:{fontSize:14},
icon:'circle',
//这两个属性设置图例前面图标大小的
itemWidth:8,
itemHeight:8,
selectedMode: false,
data:[{name:'男'},{name:'女'}]
}
2.在legendselectchanged事件里面设置,这种方法可以控制点击legend时候处理其他业务
this.$khflChart.on('legendselectchanged', (params:any) => {
that.$khflChart.setOption({
legend:{selected:{[params.name]: true}}
});
});