Skip to content

fix(bar): restore category order when realtimeSort is disabled. close… - #21876

Open
Mohitmhatre32 wants to merge 1 commit into
apache:masterfrom
Mohitmhatre32:fix/realtime-sort-reset-category-order
Open

Mohitmhatre32 wants to merge 1 commit into
apache:masterfrom
Mohitmhatre32:fix/realtime-sort-reset-category-order

Conversation

@Mohitmhatre32

Copy link
Copy Markdown

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Restores the original category order when the last bar series using realtimeSort on an axis disables it.

Fixed issues

Closes #21875.

Details

Before: What was the problem?

Turning realtimeSort off left the category axis sorted because categorySortInfo remained stored in the axis model and was reapplied on subsequent updates. This also affected other series sharing that axis.

After: How does it behave after the fixing?

The bar processor tracks which category axes use realtimeSort and clears the persisted sort before layout when sorting is no longer enabled on those axes.

Sorting is preserved while another bar series on the same axis still uses realtimeSort. Axis orders configured independently of realtimeSort are also preserved.

Document Info

  • 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

Regression tests in test/ut/spec/series/bar.test.ts cover:

  • Both category-axis orientations with canvas and SVG renderers.
  • Repeatedly enabling and disabling sorting.
  • Resizing after restoring the original order.
  • Multiple bar series sharing the category axis.
  • Preserving independently configured axis orders.

Merging options

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

Other information

Validation:

  • All 200 unit tests pass.
  • TypeScript checks pass for the main project and BMap extension.
  • Targeted ESLint and git diff --check pass.
  • The regression tests fail with the fix disabled and pass with it enabled.
E-charts-realtimesort.mp4

@echarts-bot

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

[Bug] Bars stay sorted after realtimeSort is switched off again

1 participant