Skip to content

fix(echarts): revert the grain-based bar width cap from #44628 - #45955

Merged
villebro merged 4 commits into
apache:masterfrom
villebro:villebro/revert-grain-bar-width
Nov 18, 2026
Merged

villebro merged 4 commits into
apache:masterfrom
villebro:villebro/revert-grain-bar-width

Conversation

@villebro

@villebro villebro commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

SUMMARY

Reverts the bar-width half of #44628, as agreed on #45474.

#44628 capped each bar's width at one time-grain bucket, measured across the full date span of the data (getGrainBarMaxWidth). That assumes each row is one grain bucket and that the chart always shows the full date span, and both assumptions break in common cases:

This removes getGrainBarMaxWidth, its call sites in Timeseries/transformProps.ts and MixedTimeseries/transformProps.ts, and the ONE_DAY_MS constant #44628 added for it, restoring the barMaxWidth: 100 ceiling that 6.1 shipped. The sub-hour TIMEGRAIN_TO_TIMESTAMP entries #44628 added (second, minute, and 5/10/15/30 minute) are kept: besides the cap, they drive the time axis's minInterval (and maxInterval with "Force Time Grain as Max Interval") for sub-hour grains, so a minute-grain chart keeps minInterval: 60000. A transformProps test covers this for the minute grain. Sparse sub-daily data, the case #44628 targeted, is better served by Advanced Analytics -> Null Imputation, which gives the chart the empty buckets it needs.

The other half of #44628, the coltypes/is_dttm fallback that keeps a temporal x-axis from being mislabeled with raw epoch values, is kept along with its tests. Those tests move from sparseSubDailyBarGeometry.test.ts to xAxisTemporalFallback.test.ts to match what they cover; the bar-width tests and the getGrainBarMaxWidth unit tests are removed with the code.

This supersedes #45519, which limited the cap to sub-daily grains but left the zoom problem and the sub-daily spacing mismatch in place.

BEFORE

image

AFTER

image

TESTING INSTRUCTIONS

  • npm run test -- plugins/plugin-chart-echarts: 1769 tests pass.
  • Manually: a bar chart of yearly data at the default Day grain renders full-width bars again (as on 6.1), and zooming into a dense hourly bar chart widens the bars.

ADDITIONAL INFORMATION

The cap sized each bar to one time-grain bucket measured across the full
date span of the data. That assumes each row is one grain bucket and that
the chart always shows the full span, so bars collapsed to hairlines when
rows are spaced further apart than the grain (e.g. yearly rows at the
default Day grain, apache#45474), and zooming in never widened them because the
cap is a fixed pixel value computed for the full range.

Revert the bar-width half of apache#44628 (getGrainBarMaxWidth, its call sites
in Timeseries and MixedTimeseries, the sub-hour TIMEGRAIN_TO_TIMESTAMP
entries and ONE_DAY_MS), restoring the barMaxWidth of 100 that 6.1 used.
Sparse sub-daily data is better served by Advanced Analytics -> Null
Imputation. The coltypes/is_dttm x-axis fallback from apache#44628 is kept,
along with its tests.
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.35%. Comparing base (9455393) to head (0e3ae7d).
⚠️ Report is 27 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #45955   +/-   ##
=======================================
  Coverage   85.34%   85.35%           
=======================================
  Files        3097     3097           
  Lines      212909   212881   -28     
  Branches    50193    50179   -14     
=======================================
- Hits       181716   181698   -18     
+ Misses      27768    27759    -9     
+ Partials     3425     3424    -1     
Flag Coverage Δ
javascript 81.78% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@villebro
villebro marked this pull request as ready for review November 18, 2026 01:15
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: ddd4c76dae36

The sub-hour TIMEGRAIN_TO_TIMESTAMP entries also drive the time axis
minInterval/maxInterval, independent of the bar width cap, so keep them
and cover the minute grain in a transformProps test.
Reword comments that referred to the removed bar width tests and cap,
and flatten the x-axis temporal fallback tests to top-level test().

@madhushreeag madhushreeag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well-reasoned, cleanly scoped revert :shipit:

@villebro
villebro merged commit 7fb8604 into apache:master Nov 18, 2026
89 checks passed
villebro added a commit that referenced this pull request Nov 18, 2026
@github-actions github-actions Bot added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.20.2 First shipped in 0.20.2 labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels plugins risk:chart-metadata size/XXL 🚢 0.20.2 First shipped in 0.20.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bar chart: bars on a temporal x-axis shrink to hairlines when the time grain is finer than the data (7.0.0rc2)

3 participants