Repository navigation
fix(echarts): stop the zoom controls overlapping the legend selector - #44367
Conversation
The legend's All/Inv selector buttons render at the legend's own right edge, anchored via TIMESERIES_CONSTANTS.legendTopRightOffset when a chart is zoomable. That offset (55px) left only ~12px of clearance from the zoomable toolbox's dataZoom icons (which need ~43px, right-anchored at 5px), so on charts with enough series to paginate the legend, the selector/pager controls visually collide with the toolbox restore/zoom icons in the same top-right corner. Widen the reserved gap so there is real safety margin between the two independently-positioned control clusters. Fixes #37286
The measured footprint of the zoomable toolbox is ~67px in from the chart's right edge (echarts 6 default icon sizing), not the ~43px cited in the previous comment. Restate the comment and the regression test against the real measurement so the invariant is checkable. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Code Review Agent Run #3ed7beActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44367 +/- ##
==========================================
- Coverage 80.40% 80.39% -0.01%
==========================================
Files 2932 2932
Lines 174525 174525
Branches 40548 40548
==========================================
- Hits 140319 140315 -4
- Misses 31537 31541 +4
Partials 2669 2669
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #3b5da3Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
@sadpandajoe |
|
Heya @sadpandajoe, checking back in on this one. Code LGTM, just need those before/after screenshots @SBIN2010 asked for before this can merge. Mind adding them? |
rusackas
left a comment
There was a problem hiding this comment.
Just re-posting this as an actual review so it clears my requested-review status (last time was a plain comment, which doesn't). Code still LGTM -- still just need those before/after screenshots @SBIN2010 asked for before this can merge. @sadpandajoe mind adding them?
@sadpandajoe @rusackas |
SUMMARY
On Timeseries-family charts with Zoomable enabled, the zoom toolbox
(
zoom area/restore zoom) and the legend both render in the chart'stop-right corner, and they overlap — see #37286.
getLegendPropsreservesTIMESERIES_CONSTANTS.legendTopRightOffsetpx ofclearance at the right edge for a top-oriented legend when
zoomableis set.That was 55px. Measuring what ECharts 6 actually renders, the toolbox's two
dataZoom icons occupy from 67px to 20px in from the right edge (the
component rect reaches 82px). So the legend's right edge — which includes its
own All/Inv selector buttons, since
ScrollableLegendView.layoutInnerfoldsthe selector group into the legend's
mainRect— landed roughly 12px insidethe icon band.
This raises
legendTopRightOffsetto 90, clearing the icons with margin.The offset also feeds
getHorizontalLegendAvailableWidth, so plain legendsget a correspondingly more accurate wrap estimate for zoomable charts.
Note: the earlier #38657 addressed the bottom dataZoom slider offset, which is
a different control and not what this issue reports.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
BEFORE


AFTER
TESTING INSTRUCTIONS
paginates (default legend type "Scroll", position "Top").
zoom area/restore zoomicons in the top-right no longersit under the legend's All/Inv buttons, and both remain clickable.
Unit tests:
ADDITIONAL INFORMATION