Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

yuanjiangxia
Copy link
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

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
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
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

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