• echats点击旋转并切换高亮效果


    echats点击旋转并切换高亮效果

    • 本方法前面是点击旋转,原理是每次点击是重新渲染图表,计算图标旋转角度,达到切换旋转效果,
    • 本方法后面是点击切换图标时该扇形显示高亮效果
     1 onChartClick(param) {
     2       //切换图标时计算角度
     3       let dataIndex = param.dataIndex;
     4       let angle = 0;
     5       //计算起始扇形角度
     6       if (dataIndex == 0) {
     7         this.radarOptionConfig.series[0].startAngle = this.percentArrary[0] / 2;
     8         // this.onChartDispatch = { type: "downplay" };
     9       } else {
    10         for (let i = 0; i <= dataIndex; i++) {
    11           angle += this.percentArrary[i];
    12         }
    13         let moreAngle = angle - this.percentArrary[dataIndex] / 2;
    14         this.radarOptionConfig.series[0].startAngle = moreAngle;
    15         // console.log(dataIndex);
    16       }
    17       //点击切换表格数据
    18       this.tableData = this.newVIPdataArr[dataIndex];
    19       this.navTitle = this.tableData.name;//图标对应数据显示在表格中
    20       this.triangle = "triangle" + (dataIndex % 5); //图标上三角形指示器切换颜色
    21 
    22       //点击控制高亮
    23       let obj =
    24         (this.radarOptionConfig &&
    25           this.radarOptionConfig.series &&
    26           this.radarOptionConfig.series[0] &&
    27           this.radarOptionConfig.series[0].data) ||
    28         [];
    29 
    30       const chart = this.$refs["chartContainer"].chart;
    31 
    32       obj.forEach((_, i) => {
    33         console.log(i, dataIndex);
    34 
    35         if (i === dataIndex) {
    36           chart.dispatchAction({
    37             type: "highlight",
    38             seriesIndex: 0,
    39             dataIndex
    40           });
    41           this.clickdataindex = i;
    42         } else {
    43           chart.dispatchAction({
    44             type: "downplay",
    45             seriesIndex: 0,
    46             dataIndex: i
    47           });
    48         }
    49       });
    50     },
  • 相关阅读:
    如何在外部获取当前A标签的ID值
    获取<a>标签值</a>的标签值及更改
    Mysql : Maximum execution time of 30 seconds exceeded
    Ajax+PHP实现的进度条--实例
    HTML控件 隐藏
    Ajax学习--理解 Ajax 及其工作原理
    XMLHttpRequest 对象属性参数参考
    七、smarty--缓存的控制
    六、smarty-缓存控制前的页面静态化原理
    Java 的 List 与 Scala 的 Seq 相互转换
  • 原文地址:https://www.cnblogs.com/sinceForever/p/12146260.html
Copyright © 2020-2023  润新知