Skip to content

fix(pptx): preserve hierarchical chart category parent labels via flattened_labels (#2502) - #2638

Open
İlker Oğulcan SAYIN (iosayin) wants to merge 1 commit into
microsoft:mainfrom
iosayin:fix/pptx-hierarchical-categories
Open

İlker Oğulcan SAYIN (iosayin) wants to merge 1 commit into
microsoft:mainfrom
iosayin:fix/pptx-hierarchical-categories

Conversation

@iosayin

Copy link
Copy Markdown

Closes #2502

Summary

PowerPoint charts with hierarchical category axes (multi-level categories, e.g. Year grouped with Quarter) previously lost parent labels during conversion, producing repeated ambiguous leaf labels (e.g. repeated 'Q1' rows).

Changes

  1. Updated _convert_chart_to_markdown in _pptx_converter.py to check for categories.flattened_labels (exposed by python-pptx).
  2. When available, joins the ancestor path with / (e.g. 2024 / Q1), falling back to leaf category labels for single-level categories or older objects.
  3. Added in-memory multi-level category chart regression test in tests/test_pptx.py.

All 50 tests in test_pptx.py pass.

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.

PPTX chart conversion drops parent category labels

1 participant