Charts: setting `valueAxis` skips theme styling of axis labels and axis lines

Aperta
#630 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ShotaroKataoka ci sta già lavorando.

Dal 16/11/2026.

  • #645 di @ShotaroKataoka — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
67/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start with _add_chart in sdpm/sdpm/engine/builder/elements/chart.py and read how valueAxis, categoryAxis, and _chartFingerprint distinguish edited imports from hand-written JSON. Review tests/test_chart_roundtrip.py and add the stated case: a scale-only valueAxis should retain themed tick-label size and colour. Run the chart round-trip tests; done when the regression passes without changing styling restored for unedited PPTX charts.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
What happened?

_add_chart (sdpm/sdpm/engine/builder/elements/chart.py) treats a chart that has valueAxis or categoryAxis as a round-tripped chart (if not val_axis_def and not cat_axis_def:). For such a chart it skips:

  • tick label font size, colour and font (tick_font_size, text_muted, fonts["halfwidth"])
  • the subtle axis line colour and width
  • the title colour (elif not elem.get("valueAxis")) and the data label font

So a chart written by an agent that only sets the scale ("valueAxis": {"min": 0, "max": 5, "majorUnit": 1}) gets the default chart text: large, without the theme colour or font, with default tick marks. The same chart without valueAxis gets 10pt muted labels in the template font.

This affects bar, line and radar. It matters most for radar (#623): its guide recommends valueAxis so the rings match the scoring scale, so most radar charts take this path. Rendering the chart-radar guide's example on blank-dark shows white labels at the default size and white cross tick marks on every spoke. Removing valueAxis gives themed labels.

Expected

Setting the axis scale should not turn off theme styling. Only a chart read back from a PPTX should keep the styling it came with.

Notes for the fix
  • Round-tripped charts are now told apart by _chartFingerprint. An unedited one restores _chartXml and never reaches this code, so this code path only runs for an edited import or for JSON written by hand or by an agent.
  • --minimal JSON (sdpm/sdpm/engine/schema/minimal.py) drops every _ key, including _chartFingerprint and _chartFontSize. Decide what a minimal round trip should look like before choosing the new condition.
  • Tests: tests/test_chart_roundtrip.py. Add a case where valueAxis with only min/max/majorUnit still gets the themed tick label font size and colour.
Version

main at a44c66a3 (plus #623 for the radar case)

Lingua principale
Python
Stelle
136
Fork
13
Merge medio
7h 36m
PR unite (30g)
175

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aws-samples/sample-spec-driven-presentation-maker

Tutte le issue di aws-samples/sample-spec-driven-presentation-maker

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.