zoukankan      html  css  js  c++  java
  • echarts中饼图或环形图的高亮效果(点击高亮/默认某一条高亮)

    let chooseIndex = 0;//默认选中高亮模块索引 现在是默认第一条


    that.myChart = echarts.init(document.getElementById(that.indexAll.id));
    that.myChart.clear();
    that.myChart.setOption(_option);


    //默认第一条高亮
    that.myChart.dispatchAction({type: 'highlight',seriesIndex: 0,dataIndex: 0});

    that.myChart.off('click');  //取消echarts点击多次触发
    that.myChart.on('click',function(e){
    // console.log(e)

    if(e.dataIndex != chooseIndex){
    //没用选中的取消高亮
    that.myChart.dispatchAction({type: 'downplay', seriesIndex: 0, dataIndex: chooseIndex});
    }
    //选中某一条高亮
    chooseIndex = e.dataIndex;
    that.myChart.dispatchAction({type: 'highlight',seriesIndex: 0,dataIndex: e.dataIndex});
    });
  • 相关阅读:
    makefile文件编写
    soem函数库的编译
    加秘钥的SSH
    ssh传文件
    ssh1
    安装paramiko的方法
    Ftp客户端(上传文件)
    ftp服务端
    vi编辑器没有颜色的解决办法
    socket服务器
  • 原文地址:https://www.cnblogs.com/fmm030/p/12851287.html
Copyright © 2011-2022 走看看