echarts icon indicating copy to clipboard operation
echarts copied to clipboard

fix(selectedMode): get data id first

Open susiwen8 opened this issue 3 years ago • 2 comments

Brief Information

This pull request is in the type of:

  • [x] bug fixing
  • [ ] new feature
  • [ ] others

What does this PR do?

When xAxis is category, multiple data will share same name which cause muliple data selected under single selectedMode. So rearrange getSelectionKey, it should get id first then name.

Fixed issues

  • Close #17206

Details

Before: What was the problem?

Screen Shot 2022-06-25 at 11 20 59 AM

After: How does it behave after the fixing?

Screen Shot 2022-06-25 at 11 20 38 AM

Document Info

One of the following should be checked.

  • [x] This PR doesn't relate to document changes
  • [ ] The document should be updated later
  • [ ] The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

test/scatter-selectedMode.html

Others

Merging options

  • [x] Please squash the commits into a single one when merging.

Other information

susiwen8 avatar Jun 25 '22 03:06 susiwen8

Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

echarts-bot[bot] avatar Jun 25 '22 03:06 echarts-bot[bot]

ID is usually generated by echarts. It's hard for developers to tell the rule of generating id. And when they are handling the selectedMap, their app may break when they meet generated id beyond their expectations.

Also there are cases they may need using same name to link the data and being selected together. I think the main issue here is when we generating the name of scatter on the cateogry axis. We should not only use the category name. It's a rule originally designed for bar chart, but apparently it's not applicable to scatter chart.

pissang avatar Jun 28 '22 15:06 pissang

@pissang So could we combine id and name for scatter, like name_id?

susiwen8 avatar Aug 13 '22 09:08 susiwen8

I urgently need this fix.

bomee avatar Nov 03 '22 06:11 bomee

@susiwen8 why close ?

zhaohuijun avatar Aug 31 '23 15:08 zhaohuijun

@zhaohuijun It's superseded by #18835

plainheart avatar Sep 19 '23 09:09 plainheart