Skip to content

[Feature] 是否支持不同series的不同dataIndex高亮? #18343

@sz-p

Description

@sz-p

What problem does this feature solve?

在如下场景中 需要高亮 series 0dataindex 0 以及 series 1dataindex 0, 1

原始:

image

高亮:

image

代码:

const hightLight = (e) => {
  const name = e.name;
  if (e.isFired) return;
  const series0DataIndex = [];
  const series1DataIndex = [];
  for (let i = 0; i < levelOData.length; i++) {
    if (levelOData[i].name === name) {
      series0DataIndex.push(i);
    }
  }
  for (let i = 0; i < level1Data.length; i++) {
    if (level1Data[i].name === name) {
      series1DataIndex.push(i);
    }
  }
  console.log(series1DataIndex);
  console.log(series0DataIndex);

  myChart.dispatchAction({
    type: 'highlight',
    seriesIndex: [0, 1],
    isFired: true,
    // 期望 这里根据不同的series去做区分
    dataIndex: [series1DataIndex, series0DataIndex],
  });
};
myChart.on('highlight', hightLight);

如果不支持的话是否有代替方案?

Demo

https://stackblitz.com/edit/js-wn7p1d?file=index.html,index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions