echarts 饼图legend点击不置灰
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}}
});
});
本站所有文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。
如果侵犯了你的权益请来信告知我们删除。邮箱:licqi@yunshuaiweb.com
上一篇:【Vue+Echarts】天坑 子组件中的Echarts Cannot read properties of undefined (reading ‘getAttribute‘)“
下一篇:Failed to execute ‘getImageData’ on ‘CanvasRenderingContext2D’ 问题解决方法