Echarts 高亮

摘要:初始的时候 高亮对应选项

需要注意对应的顺序,不能乱了,需要先setoption之后在进行高亮,后面的是处理对应悬浮时间,否则会高亮覆盖文案

    myChart.setOption(option)
      setTimeout(() => {
        myChart.dispatchAction({
          type: 'highlight',
          seriesIndex: 0,
          dataIndex: 0
        })
      }, 500)
      myChart.on('mouseover', (v) => {
        myChart.dispatchAction({
            type: 'downplay',
            seriesIndex: 0,
            dataIndex: 0
        })
      })
      myChart.on('mouseout', (v) => {
        myChart.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: 0 })
      })


评论