Skip to content

fix(bar): draw a polar bar series normally when large is set - #21866

Open
Xnadir wants to merge 1 commit into
apache:masterfrom
Xnadir:fix/bar-polar-large
Open

Xnadir wants to merge 1 commit into
apache:masterfrom
Xnadir:fix/bar-polar-large

Conversation

@Xnadir

@Xnadir Xnadir commented Nov 23, 2026

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Draws a polar bar series with large: true normally instead of throwing, since large mode is only laid out for cartesian2d.

Fixed issues

Details

Before: What was the problem?

preparePipelineContext sets large whenever large: true and the data count reaches largeThreshold. BarSeries.getProgressive() also enables progressive rendering when large is set. But the large layout (largePoints) is only built for cartesian2d. On a polar bar series, BarView took the large path, built a LargePath without points, and threw TypeError: Cannot read properties of undefined (reading 'length') in LargePath.buildPath. Nothing was drawn.

After: How does it behave after the fixing?

BarSeries checks coordinateSystem === 'cartesian2d' before entering large or progressive rendering. On polar, __preparePipelineContext turns large and progressiveRender off and getProgressive() returns false, so the series renders through the normal path. That is the fallback the issue expects. Cartesian2d is unchanged.

Tests added to test/ut/spec/series/bar.test.ts:

  • a polar bar with large: true, largeThreshold: 2 and three items must not throw, and every item must have a graphic element. It fails on master with the TypeError;
  • a cartesian2d bar with the same settings still has pipelineContext.large === true.

Ran locally:

  • npx jest --config test/ut/jest.config.cjs test/ut/spec (all unit tests pass);
  • eslint on the changed files;
  • tsc -p tsconfig.json --noEmit.

Document Info

  • This PR doesn't relate to document changes

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

This change was written with the help of Claude Code (AI). I reviewed it and ran the tests above.

🤖 Generated with Claude Code

…pache#21856

Large mode is only laid out for cartesian2d, but BarSeries entered it
whenever large was set and the data reached largeThreshold. On polar,
BarView then built a LargePath with no points and threw "Cannot read
properties of undefined (reading 'length')", and nothing was drawn.

BarSeries now turns large and progressive rendering off unless the
series is on cartesian2d, so a polar bar series falls back to normal
rendering.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@echarts-bot

echarts-bot Bot commented Nov 23, 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.

This branch has not been deployed

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