Repository navigation
Fix PPTX charts: preserve hierarchical (parent) category labels - #2659
Open
Wu Shuwen (dajiaohuang) wants to merge 1 commit into
Open
Wu Shuwen (dajiaohuang) wants to merge 1 commit into
Wu Shuwen (dajiaohuang) wants to merge 1 commit into
Conversation
Fixes microsoft#2502. python-pptx exposes multi-level category paths via Categories.flattened_labels as tuples (e.g. ('2024', 'Q1'), ('2025', 'Q1')), but PptxConverter was only reading the leaf label via c.label, dropping parent labels entirely so a year/quarter chart produced two identical 'Q1' rows. Use flattened_labels to render each level of the category hierarchy as its own column. Single-level (flat) category charts are unchanged. Also keep the None->empty-cell fix from microsoft#2526.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2502.
python-pptx exposes multi-level category paths via
Categories.flattened_labelsas tuples (e.g.('2024', 'Q1'), ('2025', 'Q1')), butPptxConverterwas only reading the leaf label viac.label, dropping parent labels entirely so a year/quarter chart produced two identical 'Q1' rows.Use
flattened_labelsto render each level of the category hierarchy as its own column (Category (L1),Category (L2), ...). Single-level (flat) category charts are unchanged (singleCategorycolumn). Also keeps the None→empty-cell fix for missing data points.