fix(xlsx): inset data bars from the row edges like Excel#455
Merged
Conversation
Data bars were given the full cell content height, so they filled the row and merged vertically into a continuous band. Native Excel insets them: its PDF exports print a 10 pt bar in every 14 pt row of the business corpus. Subtract 2 pt of clearance per side, with a floor so short rows keep a visible bar. On the inventory fixture the rendered bar height moves from 13.184 pt to 9.189 pt against Excel's 10.000 pt, and the row gaps Excel leaves between bars are restored. Fixes #418 Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
developer0hye
force-pushed
the
fix/xlsx-data-bar-height
branch
from
July 25, 2026 10:28
4b642dc to
e237775
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related issue
Fixes #418
Testing
cargo test --workspace(1817 tests, all pass)cargo clippy --workspace --all-targets(clean)cargo fmt --checkpdftocairo -svgon page 1 of both PDFs to read the rendered gradient geometry directlypdftoppm -r 150plus matched-region crops of theOn Handcolumn at 300% scaleFirst data bar transform on page 1 of
03_inventory_en:matrix(36, 0, 0, 10, 326, 134)matrix(36.203705, 0, 0, 13.184054, 325.606174, 132.443447)matrix(34.85704, 0, 0, 9.188886, 325.606174, 134.441031)The height error moves from +31.8% to -8.1%, and the white gaps Excel leaves between consecutive bars are restored. The residual comes from the auto-height branch approximating the printed row track as
1.2em; these rows are content-driven because they contain a wrapping cell, so the calibrated 14 pt track is not available to the renderer.Visual impact
Visual audit
fixassets/bugfixes/issue-418/gt.jpgassets/bugfixes/issue-418/before.jpgassets/bugfixes/issue-418/after.jpgassets/bugfixes/issue-418/compare.jpgVisual comparison
Required inspection
Deviation audit
638EC6gradient and its lightened stop are preservedChecklist
Signed-off-byline