Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(scale): correct bar height when zoomed with dataZoom filterMode i…#21524

Open
akashsonune wants to merge 2 commits intoapache:masterfrom
akashsonune:fix/issue-19666-bar-datazoom-height
Open

fix(scale): correct bar height when zoomed with dataZoom filterMode i…#21524
akashsonune wants to merge 2 commits intoapache:masterfrom
akashsonune:fix/issue-19666-bar-datazoom-height

Conversation

@akashsonune
Copy link
Contributor

…s none

Fixes #19666

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fixed issues

Details

Before: What was the problem?

After: How does it behave after the fixing?

Document Info

One of the following should be checked.

  • 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

Security Checking

  • This PR uses security-sensitive Web APIs.

ZRender Changes

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

Related test cases or examples to use the new APIs

N.A.

Merging options

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

Other information

@echarts-bot
Copy link

echarts-bot bot commented Mar 2, 2026

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.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

⚠️ MISSING DOCUMENT INFO: Please make sure one of the document options are checked in this PR's description. Search "Document Info" in the description of this PR. This should be done either by the author or the reviewers of the PR.

@akashsonune akashsonune force-pushed the fix/issue-19666-bar-datazoom-height branch from eec6f72 to b7f7313 Compare March 2, 2026 18:05
// When extent collapses to a single point, only values equal to that point
// should be normalized to 0.5. All other values should return NaN to indicate
// they are out of range and should not be rendered.
return isNaN(val) || val !== extent[0] ? NaN : 0.5;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure val !== extent[0] is expected, please also help test the cases for markPoints to display correctly for single data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Ovilia I added tests for markpoint. also I feel the condition val !== extent[0] is needed becuase When the range collapses to a single point, only the value that matches that point should be drawn. Everything else should be ignored (NaN).

Without this check, ALL bars try to draw at the same position, causing the visual bug where zoomed single bar looks like it has value of the highest bar in the series

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] Incorrect display of Series bars on zoom in

2 participants