echart默认点击legend时候当前点击legend会置灰,有两种方式不置

1.设置selectedModefalse,这种方法控制不能点击legend

legend: {

                orient: ‘vertical’,

                x:’center‘,

                y:’center’,

                textStyle:{fontSize:14},

                icon:’circle‘,

                //这两个属性设置图例前面图标大小

                itemWidth:8,

                itemHeight:8,

                selectedModefalse,

                data:[{name:’男’},{name:’女’}]

            }

2.在legendselectchanged事件里面设置,这种方法可以控制点击legend时候处理其他业务

this.$khflChart.on(‘legendselectchanged‘, (params:any) => {

            that.$khflChart.setOption({

                legend:{selected:{[params.name]: true}}

            });

        });

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注