fix(echarts): fix stacked horizontal bar chart clipping and duplicate x-axis labels#39012
Conversation
Code Review Agent Run #ede868Actionable 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 |
2ee1490 to
dee926b
Compare
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #39012 +/- ##
=======================================
Coverage 64.42% 64.42%
=======================================
Files 2536 2536
Lines 131103 131113 +10
Branches 30434 30441 +7
=======================================
+ Hits 84467 84476 +9
- Misses 45173 45174 +1
Partials 1463 1463
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Bito Automatic Review Skipped – PR Already Merged |
User description
SUMMARY
Fixes two related bugs in the ECharts horizontal stacked bar chart (
echarts_timeseries_barwith horizontal orientation andtruncateYAxisenabled):xAxis.max, ECharts generated ticks at sub-integer intervals (e.g. 0.5 steps), and the integer formatter produced labels like1 2 2 3 3 4 4.Root cause
shouldCalculateDataBoundscomputesyAxisMaxfrom individual per-series values (dataMax). For a stacked chart this is incorrect — the axis maximum must accommodate the stacked total per row, not any single series value.Example: with series
High=2,Low=2,Medium=4,dataMax=4but the stacked total is8. SettingxAxis.max=4clips bars at half their height and produces a cramped axis range that triggers duplicate tick labels.Fix
When
stackis truthy, use the max ofsortedTotalValues(per-row stacked totals already computed byextractSeries) as the effective axis max instead ofdataMax.Additionally, guard the
stackDimensionseries assignment to skipundefineddimension values, preventing accidental overwrite of thestackproperty withundefined.Fixes #38989
Fixes #38988
BEFORE / AFTER
TESTING INSTRUCTIONS
echarts_timeseries_bar, orientation = Horizontal) with multiple metrics andStackenabled.Truncate Y Axis(or set y-axis bounds).ADDITIONAL INFORMATION
CodeAnt-AI Description
Fix stacked horizontal bar charts so bars are fully visible and axis labels stay clean
What Changed
Impact
✅ Fewer clipped stacked bars✅ Clearer axis labels on horizontal charts✅ More reliable stacked bar grouping💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.