Skip to content

fix(dataZoom): avoid NaN in single-point shadow. close #21649#21668

Open
rahul37wallst-sudo wants to merge 1 commit into
apache:masterfrom
rahul37wallst-sudo:investigate-21649-datazoom-single-point-shadow
Open

fix(dataZoom): avoid NaN in single-point shadow. close #21649#21668
rahul37wallst-sudo wants to merge 1 commit into
apache:masterfrom
rahul37wallst-sudo:investigate-21649-datazoom-single-point-shadow

Conversation

@rahul37wallst-sudo

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fixes slider dataZoom data shadow rendering for single-point time-axis series by avoiding NaN shadow coordinates.

Fixed issues

Details

Before: What was the problem?

For slider dataZoom with showDataShadow: true on a time axis, a single-point shadow-source series produced a zero-width data extent.

That made the time-axis shadow coordinate normalization divide by zero:

size[0] / (thisDataExtent[1] - thisDataExtent[0])

The resulting Infinity could then produce NaN shadow coordinates, causing the slider data shadow to disappear.

After: How does it behave after the fixing?

The time-axis proportional coordinate path is now used only when the data extent span is positive and finite.

For single-point time-axis data, the slider data shadow falls back to the existing step-based coordinate path, keeping polygon/polyline points finite and allowing the shadow to render.

A regression test was added for a single-point time-axis slider dataZoom case.

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

Added unit regression test:

  • test/ut/spec/component/dataZoom/SliderZoomView.test.ts

Validation run:

  • npx jest --config test/ut/jest.config.cjs --coverage=false test/ut/spec/component/dataZoom/SliderZoomView.test.ts --runInBand
  • npx eslint src/component/dataZoom/SliderZoomView.ts test/ut/spec/component/dataZoom/SliderZoomView.test.ts
  • git --no-pager diff --check
  • npm run checktype

Merging options

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

Other information

@echarts-bot

echarts-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

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.

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.

1 participant