Skip to content

fix: honor category-axis number formats - #1556

Merged
developer0hye merged 1 commit into
mainfrom
fix/issue-1267-category-axis-blanking
Sep 5, 2026
Merged

fix: honor category-axis number formats#1556
developer0hye merged 1 commit into
mainfrom
fix/issue-1267-category-axis-blanking

Conversation

@developer0hye

@developer0hye developer0hye commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

Honor catAx/numFmt when rendering numeric category-axis labels. The budget workbook declares ;;, so Excel leaves the category-label band blank while office2pdf printed 1, 2, and 3. Preserve the original category slots and chart geometry, formatting only the visible labels for bar, column, line, area, and radar charts.

Retain the category format in Chart and reuse the XLSX literal-section decoder for empty or quoted sections. This also works with published umya-spreadsheet 2.3.3; the corresponding dependency correction has already merged upstream in MathNya/umya-spreadsheet#361. Numeric formats continue through the existing formatter. Text categories retain their text.

Related: #1267.

Testing

  • Red: the real workbook's chart regression emitted three labels instead of zero before the implementation.
  • cargo test --locked -p office2pdf --lib category_number_format (3 passed): real chart XML, five axis-chart families, positive/negative/zero values, empty sections, numeric formatting, text categories, and quoted semicolons.
  • cargo test --locked --workspace (passed, including integration tests and doctests)
  • cargo check --locked --workspace
  • cargo clippy --locked --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • python3 -m unittest discover -s scripts/tests -p 'test_*.py' (389 passed)
  • git diff --check
  • Native Excel GT integrity check, both-page layout and text-layer comparison, and strict raster-cluster reports. Main baseline and after use identical Cargo.lock and Excel's DFonts directory. Page 1 has zero changed pixels at 150 DPI; page 2 changes exactly 465 pixels at 300 DPI, solely the three removed digits. Every other matched text position and all 847 canonical page-2 rectangles remain unchanged. Raw extraction order differs, but whitespace-normalized pdftotext -layout content matches native on both pages.

Reproduce conversion with cargo run --locked -p office2pdf-cli -- tests/fixtures/xlsx/issue_1181_fit_to_height.xlsx -o output.pdf --font-path '/Applications/Microsoft Excel.app/Contents/Resources/DFonts'. Compare the native and output PDFs with scripts/compare_layout.py GT.pdf output.pdf --audit --fine-shift 0.5 --json, scripts/compare_text_layer.py GT.pdf output.pdf, and scripts/compare_render.py GT.pdf output.pdf --page P --dpi DPI --fine-shift 0.5 --cluster-report PATH --cluster-dispositions PATH --strict-clusters (page 1: 150 DPI; page 2: 300 DPI).

Visual impact

  • Rendered PDF change or visual evidence added

Visual audit

Visual comparison

Native Excel 16.112.3 exports, verified Excel/Quartz PDF provenance. Page 2 at 300 DPI:

GT Before After
GT Before After

The unchanged page-1 native comparison is attached to #1550, #1551, and #1552.

Required inspection

  • Rendered all evidence at 150 DPI or higher
  • Stored progressive JPEG quality 86 assets with metadata stripped
  • Used Codex/Claude vision to inspect the full GT/output pages, diff, and matched crops
  • Inspected matched region crops at full resolution
  • Ran compare_layout.py --audit --fine-shift PT and dispositioned every fine/large text-instance shift, rectangle geometry deviation, painted-text visibility mismatch, and visible-fill occlusion
  • Ran compare_render.py --cluster-report PATH --strict-clusters and dispositioned every material 5% fuzz diff cluster by explicit ID
  • Inventoried hairlines and border dash styles
  • Inventoried font weight, italic, and underline emphasis

Deviation audit

Check Result
Page count/order Matches GT: two printable sheets retain their native order.
Element presence Remaining: #1185 marker rendering, #1270 no-fill series, and #1271 gridlines. The three unwanted numeric category labels are fixed.
Position/size Remaining: #1272 chart frame, #1542 fitted drawings, #1545 fixed-row text, #1550 title-row height, and #1552 footer position.
Rotation/flip No deviation observed: no transform changes.
Fill Remaining: #1270 unwanted colored series; page, table, and header colors match.
Stroke/border Remaining: #1271 and #1274 chart gridline presence and opacity. Gray table hairlines, teal total rules, and brown category rules retain their paths; no dashed or dotted source rules are lost.
Shape outline geometry Remaining: #1185 marker, #1270 no-fill series, #1272 chart frame, and #1550 title-band height. Baseline-to-after rectangle geometry is unchanged.
Text content Fixed: number-format ;; suppresses category digits 1, 2, 3; native and after pdftotext -layout content matches after whitespace normalization.
Font family/weight/style Matches GT: regular chart labels, bold Cambria section headings, bold Trebuchet expense headings, Arial bold instruction title, and Aptos footer are preserved. No italic or underlined runs are changed.
Text color Matches GT: chart labels and worksheet text retain their colors.
Alignment Remaining: #1542 drawing labels, #1545 row text, #1550 first-page content, and #1552 footer baselines.
Line/paragraph spacing Remaining: #1545 fixed-row seating and #1551 wrapped note line pitch.
Clipping/overflow No deviation observed: no new clipping or overflow; native and output both display ##### in the narrow annual-total cells.

Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit 99ca7f0 into main Sep 5, 2026
18 checks passed
@developer0hye
developer0hye deleted the fix/issue-1267-category-axis-blanking branch September 6, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant