Vue Echarts 饼图设置默认选中一个

Vue Echarts 饼图设置默认选中一个

        myChart.setOption(data) // data伟echarts所需要传入的参数,就是配置参数最多的那个玩意
        myChart.dispatchAction({ type: 'highlight', dataIndex: 0 }); // dataIndex属性伟data传入的索引值
        myChart.dispatchAction({ type: 'showTip', seriesIndex: 0, position: [120, 220], dataIndex: 0 }); // 点击生成detip工具条位置
        myChart.on('mouseover', (e) => {
          if (e.dataIndex !== 0) { // 当鼠标移除的时候 使默认的索引值去除默认选中
            myChart.dispatchAction({ type: 'downplay', dataIndex: 0 });
          }
        });

路过点赞,好人一生平安