Skip to content

Charts: a category axis' blanking c:numFmt (formatCode=";;") is ignored, so an axis Excel leaves empty prints 1, 2, 3 #1267

Description

@developer0hye

<c:catAx><c:numFmt formatCode=";;" sourceLinked="0"/> is a number format whose
three sections are all empty, which is Excel's way of printing nothing for a
positive, a negative or a zero value alike. A template uses it to keep an axis
whose labels would be meaningless from printing them. We never apply a category
axis' c:numFmt, so the labels print.

Measured

Monthly college budget1.xlsx (attached to #1123, committed as
tests/fixtures/xlsx/issue_1181_fit_to_height.xlsx), sheet Monthly college budget, xl/charts/chart1.xml — the january cash flow: bar chart. Its
category axis is not deleted, and it carries the blanking format:

<c:catAx><c:axId val="483691008"/><c:scaling><c:orientation val="minMax"/></c:scaling>
  <c:delete val="0"/><c:axPos val="l"/>
  <c:numFmt formatCode=";;" sourceLinked="0"/>
  <c:majorTickMark val="none"/><c:minorTickMark val="none"/>
  <c:tickLblPos val="nextTo"/>

The chart declares no <c:cat>, so the categories are the automatic 1..N.
Native Excel for Mac 16 export against our page 1, mutool draw -F trace,
printed points, y down from the page top:

instance GT ours
3 not drawn x 613.09, baseline 195.97
2 not drawn x 613.09, baseline 228.05
1 not drawn x 613.09, baseline 260.14

The export draws no fill_text at all in that chart's category band; we draw
three digits down the left of its plot.

Reproduction

office2pdf --sheets "Monthly college budget" tests/fixtures/xlsx/issue_1181_fit_to_height.xlsx -o ours.pdf
mutool draw -F trace -o - ours.pdf 1 | grep -B 3 'unicode="3"'

Expected

A category axis whose c:numFmt formats every value to the empty string prints
no tick labels, and keeps whatever band the layout gives them.

Found while auditing #1182 on the same page; present before and after that fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions