Skip to content

fix(dataZoom): fix the dataZoom was unexpectedly displayed at the top when data contains null values#16730

Merged
pissang merged 1 commit intoapache:masterfrom
yuanjiangxia:fix-dataZoom
Mar 23, 2022
Merged

fix(dataZoom): fix the dataZoom was unexpectedly displayed at the top when data contains null values#16730
pissang merged 1 commit intoapache:masterfrom
yuanjiangxia:fix-dataZoom

Conversation

@yuanjiangxia
Copy link
Copy Markdown
Contributor

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fix the dataZoom was unexpectedly displayed at the top when data contains null values. Fixes #16476.

Fixed issues

Details

Before: What was the problem?

image

After: How is it fixed in this PR?

image

Misc

  • The API has been changed (apache/echarts-doc#xxx).
  • This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

Refer to the last case in test/dataZoom-feature.html.

Others

Merging options

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

Other information

@echarts-bot
Copy link
Copy Markdown

echarts-bot Bot commented Mar 23, 2022

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.

@plainheart
Copy link
Copy Markdown
Member

It seems this bug was brought by the refactor in #15355.

echarts/src/data/List.ts

Lines 580 to 582 in 0d5496f

const dimRawExtent = rawExtentArr[dimIdx];
val < dimRawExtent[0] && (dimRawExtent[0] = val);
val > dimRawExtent[1] && (dimRawExtent[1] = val);

The old comparison is okay with the NaN value but the Math.min isn't.

Copy link
Copy Markdown
Member

@plainheart plainheart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pissang pissang merged commit 4f7e2d7 into apache:master Mar 23, 2022
@echarts-bot
Copy link
Copy Markdown

echarts-bot Bot commented Mar 23, 2022

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [dataZoom]

3 participants