From 19e7eb4fdc98b12e59c1d63f18c148eb767f5fbf Mon Sep 17 00:00:00 2001 From: Srajan-Sanjay-Saxena Date: Sat, 15 Nov 2025 20:46:18 +0530 Subject: [PATCH] fix: adding the final fix for re-rendering issue --- src/core/echarts.ts | 6 ++ test/toolbox-brush-rerender-fix.html | 90 ++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 test/toolbox-brush-rerender-fix.html diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 89f810088b..b54035da2d 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -2317,6 +2317,12 @@ class ECharts extends Eventful { renderComponents(ecIns, ecModel, api, payload, updateParams); + // Skip series rendering for takeGlobalCursor to prevent unnecessary re-render + // when user clicks toolbox buttons (brush, dataZoom, etc.) + if (payload && payload.type === 'takeGlobalCursor') { + return; + } + each(ecIns._chartsViews, function (chart: ChartView) { chart.__alive = false; }); diff --git a/test/toolbox-brush-rerender-fix.html b/test/toolbox-brush-rerender-fix.html new file mode 100644 index 0000000000..d300f9137d --- /dev/null +++ b/test/toolbox-brush-rerender-fix.html @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + Toolbox DataZoom Re-render Fix Test + + + + +
+

Test: Toolbox Box Select Re-render Fix

+

Issue: Clicking the "Box Select" (rect) button in the brush toolbox causes the entire chart to re-render with progressive animation.

+

Expected: Clicking the toolbox button should NOT trigger a re-render; it should only change the cursor mode.

+

Test: Click the "Box Select" (rect) icon in the toolbox. The chart should NOT animate/re-render.

+
+ +
+ + + +