Skip to content

[Bug] the dataIndex is not work when I give it a array in dispatchAction #16913

@xiaolicui

Description

@xiaolicui

Version

5.3.2

Link to Minimal Reproduction

No response

Steps to Reproduce

that is what I code:

  <div style="width: 500px; height: 300px" id="echart">
  </div>

import * as echarts from 'echarts'
// 基于准备好的dom,初始化echarts实例
    var myChart = echarts.init(document.getElementById('echart'));
    // 绘制图表
    myChart.setOption({
      title: {
        text: 'ECharts 入门示例'
      },
      tooltip: {},
      xAxis: {
        data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
        type: 'category'
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          selectedMode: false,
          select: {
            itemStyle: {
              color: 'gray'
            }
          },
          name: '销量',
          type: 'bar',
          data: [5, 20, 36, 10, 10, 20]
        }
      ]
    });
    myChart.on('click', function() {
      myChart.dispatchAction({
        type: 'showTip',
        seriesIndex: 0,
        dataIndex: [1, 2, 3]
      })
    });

Current Behavior

when I click the chart , only the last item work in the dataIndex array

Expected Behavior

all the item work in that dataIndex array

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpendingWe are not sure about whether this is a bug/new feature.staleInactive for a long time. Will be closed in 7 days.topic: eventwaiting-for: author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions