Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

Fix/toolbox selection chart rerender#21375

Open
Srajan-Sanjay-Saxena wants to merge 1 commit intoapache:master from
Srajan-Sanjay-Saxena:fix/toolbox-selection-chart-rerender
Open

Fix/toolbox selection chart rerender #21375
Srajan-Sanjay-Saxena wants to merge 1 commit intoapache:master from
Srajan-Sanjay-Saxena:fix/toolbox-selection-chart-rerender

Conversation

@Srajan-Sanjay-Saxena
Copy link
Contributor

@Srajan-Sanjay-Saxena Srajan-Sanjay-Saxena commented Nov 14, 2025

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Prevents unnecessary chart re-rendering when clicking toolbox buttons (brush, dataZoom selection tools) by skipping series rendering for takeGlobalCursor actions.

Fixed issues

  • Fixes performance issue where clicking toolbox selection buttons caused entire chart to re-render with progressive animation, especially problematic with large datasets (10,000+ points)

Details

Before: What was the problem?

When users clicked toolbox buttons like "Box Select" (brush rect) or dataZoom selection tools, the entire chart would re-render including all series data points. This triggered:

  • Progressive rendering animation replaying from scratch
  • Significant performance degradation with large datasets
  • Poor user experience as the chart appeared to "reload" just to change cursor mode

Root Cause: The takeGlobalCursor action was registered with update: 'update', which triggered the full update pipeline including render()renderSeries(), causing all chart series to re-render even though only UI state (toolbox icons, brush controller) needed updating.

Investigation Journey:

  1. Initially tried changing update: 'update' to update: 'none' and manually calling component updates in a custom action handler
  2. This worked but required complex manual orchestration of brush model updates and view updates
  3. Then attempted update: 'toolbox:updateView' and other targeted update strategies
  4. Realized the issue: we needed components to update (toolbox, brush) but NOT series to render

After: How does it behave after the fixing?

Clicking toolbox buttons now:

  • ✅ Instantly activates the tool (brush/dataZoom selection) without any re-rendering
  • ✅ Updates toolbox icon states correctly (emphasis/normal)
  • ✅ Enables/disables brush controllers properly
  • ✅ No progressive animation or performance impact
  • ✅ Works seamlessly with large datasets

The Fix: Added a simple early return in the render() function to skip series rendering when the payload type is takeGlobalCursor:

if (payload && payload.type === 'takeGlobalCursor') {
 return;
}

i am attaching a video of the fix

2025年11月15日.01-18-41.mp4

Copy link

echarts-bot bot commented Nov 14, 2025

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.

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@plainheart plainheart Awaiting requested review from plainheart

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /