Charts: axis c:spPr is appended out of OOXML schema order
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Start in sdpm/sdpm/engine/builder/elements/chart.py, in the “Axis lines” block of _add_chart, and check the other c:spPr insertions against the axis schema order. Build bar and line charts, then verify that c:spPr precedes c:txPr and c:crossAx in c:valAx and c:catAx; run ruff and pytest sdpm/tests/test_chart_roundtrip.py, and add a Fixed entry under [Unreleased] in CHANGELOG.md.
Written by the indexing model from the issue text.
Description
Summary
When the chart builder styles the axis line, it adds the axis c:spPr with etree.SubElement(ax_el, qn('c:spPr')). That appends it as the last child of c:valAx / c:catAx. In the OOXML schema (CT_ValAx / CT_CatAx), c:spPr belongs after c:tickLblPos and before c:txPr / c:crossAx. So the generated chart XML is out of schema order.
Where
sdpm/sdpm/engine/builder/elements/chart.py, the "Axis lines" block in _add_chart (two places: the themed default and the valueAxis.line == "none" branch). The same pattern may apply to other SubElement(..., 'c:spPr') calls in that function; worth checking each against the schema.
Why it matters
As far as I know, PowerPoint accepts this today, so it is a latent problem rather than a visible one. I have not tested every Office version. Strict consumers and validators can reject it, and it will bite when a new chart type (see #620, #621, #622) reuses this code.
Expected
Insert c:spPr at its schema position instead of appending. For example, insert it before the first existing c:txPr, c:crossAx or c:crosses child, or immediately after c:tickLblPos when present.
Done when
- A helper (for example
_insert_in_order) putsc:spPrin the right place forc:valAxandc:catAx. - A test builds a bar and a line chart (the types that have axes) and checks that, in
c:valAxandc:catAx,c:spPrcomes beforec:txPrandc:crossAx. -
CHANGELOG.md[Unreleased]has aFixedentry. -
ruffandpytest sdpm/tests/test_chart_roundtrip.pypass.
This is a good first issue: one file, one helper, one test.
🤖 Created by Kiro Crew
- Dominant language
- Python
- Stars
- 136
- Forks
- 13
- Avg merge
- 7h 43m
- Merged PRs (30d)
- 180
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws-samples/sample-spec-driven-presentation-maker
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
aws-samples/sample-spec-driven-presentation-maker#646 ·
Maintainers usually reply within 1 day
-
Charts: setting `valueAxis` skips theme styling of axis labels and axis linesPossibly taken @ShotaroKataoka claimed this 1 day ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
aws-samples/sample-spec-driven-presentation-maker#630 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 50/100
aws-samples/sample-spec-driven-presentation-maker#627 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 4/5 3-5 days Newbie friendliness 68/100
aws-samples/sample-spec-driven-presentation-maker#622 ·
Maintainers usually reply within 1 day
-
Charts: add radar charts (chartType "radar")Possibly taken @tridev-tej claimed this 4 days ago. Openenhancement good first issue
Difficulty 4/5 3-5 days Newbie friendliness 25/100
aws-samples/sample-spec-driven-presentation-maker#621 ·
Maintainers usually reply within 1 day
All issues in aws-samples/sample-spec-driven-presentation-maker
Similar issues
-
firestore: enable live window.yaml pipeline system tests once add_window_fields is in productionOpen
Difficulty 1/5 Under an hour Newbie friendliness 64/100
googleapis/google-cloud-python#19115 ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug prov-json
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day