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

时间:2019-12-03 18:41:22   收藏:0   阅读:1257

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 });
          }
        });

路过点赞,好人一生平安

原文:https://www.cnblogs.com/wangjiahui/p/11977959.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!