echarts [Bug] 当series.type="lines" 时dispatchAction 控制高亮无效

whlutmcx  于 2022-11-02  发布在  Echarts
关注(0)|答案(2)|浏览(626)

Version

5.3.2

  • No response*

Steps to Reproduce

series:

series: [
          {
            type: "lines",
            coordinateSystem: "amap",
            effect: {
              show: true,
              period: 2, //箭头指向速度,值越小速度越快
              trailLength: 0.1, //特效尾迹长度[0,1]值越大,尾迹越长重
              symbol: "arrow", //箭头图标
              symbolSize: 10, //图标大小
            },
            label: {
              show: false
            },
            lineStyle: {
              normal: {
                color: '#1890ff',
                width: 1, //尾迹线条宽度
                opacity: 0.5, //尾迹线条透明度
                curveness: 0.3, //尾迹线条曲直度
              },

            },
            data: [ ],
          },
          {
            type: "effectScatter",
            coordinateSystem: "amap",
            showEffectOn: "render",
            zlevel: 1,
            rippleEffect: {
              period: 2,
              scale: 5,
              brushType: "stroke",
            },
            label: {
              show:true,
              color:'#fff',
                formatter: "{b}",
                position: "right",
            },
            emphasis: {
              scale: true,
              itemStyle: {
                blurScope: 'global',
                borderType: "solid",
                borderColor: "rgba(252,4,4,1)",
                borderWidth: 1,
                color: 'rgba(255,0,0,1)',
              },
              label:{
                fontSize: 13 ,
                color: 'rgba(255,0,0,1)',
                textBorderColor:'#fff',
                textBorderWidth:'2'
              }
            },
            hoverAnimation: true,
            symbolSize: 10,
            data: []

dispatchAction:

/**

* @description 控制高亮跟提示
* @param {String} type (highlight:高亮(反:downplay);showTip:显示提示(反:hideTip))
* @param {Number} dataIndex 数据项的 index
* */

    dispatchActionChart(type, dataIndex) {
      this.chart.dispatchAction({
        type: type,
        seriesIndex: [0,1],
        dataIndex: dataIndex,
      });
    },

Current Behavior

制作Map航线图表时当 series.type="effectScatter " 时 dispatchAction 设置高亮正常
制作Map航线图表时当 series.type="lines" 时 dispatchAction 设置高亮无效

Expected Behavior

希望 dispatchAction 也可以设置 lines 的高亮

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

  • No response*
tsm1rwdh

tsm1rwdh1#

@blossomwave It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] The sessionAction control highlighting is invalid when series.type="lines"

BODY

Version

5.3.2

  • No response*

Steps to Reproduce

series:

series: [
          {
            type: "lines",
            coordinateSystem: "amap",
            effect: {
              show: true,
              period: 2, //The arrow points to the speed, the smaller the value, the faster the speed
              trailLength: 0.1, //The larger the value of special effect trail length [0,1], the longer and heavier the trail is.
              symbol: "arrow", //arrow icon
              symbolSize: 10, //icon size
            },
            label: {
              show: false
            },
            lineStyle: {
              normal: {
                color: '#1890ff',
                width: 1, //The width of the trail line
                opacity: 0.5, //The transparency of the trail line
                curveness: 0.3, //The straightness of the trail line
              },

            },
            data: [ ],
          },
          {
            type: "effectScatter",
            coordinateSystem: "amap",
            showEffectOn: "render",
            zlevel: 1,
            rippleEffect: {
              period: 2,
              scale: 5,
              brushType: "stroke",
            },
            label: {
              show:true,
              color:'#fff',
                formatter: "{b}",
                position: "right",
            },
            emphasis: {
              scale: true,
              itemStyle: {
                blurScope: 'global',
                borderType: "solid",
                borderColor: "rgba(252,4,4,1)",
                borderWidth: 1,
                color: 'rgba(255,0,0,1)',
              },
              label:{
                fontSize: 13 ,
                color: 'rgba(255,0,0,1)',
                textBorderColor:'#fff',
                textBorderWidth:'2'
              }
            },
            hoverAnimation: true,
            symbolSize: 10,
            data: []

dispatchAction:

/**

* @description controls highlighting and prompting
* @param {String} type (highlight: highlight (inverse: downplay); showTip: show tip (inverse: hideTip))
* @param {Number} dataIndex The index of the data item
* */

    dispatchActionChart(type, dataIndex) {
      this.chart.dispatchAction({
        type: type,
        seriesIndex: [0,1],
        dataIndex: dataIndex,
      });
    },

Current Behavior

When making a map route chart, when series.type="effectScatter ", dispatchAction is set to highlight normally
When making a map route chart, when series.type="lines", the dispatchAction setting highlight is invalid

Expected Behavior

Hope dispatchAction can also set the highlight of lines

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

  • No response*

相关问题