Fix multi lvl categories in embedded .xlsx #1330
Open
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.
Change Summary
A key/value object was added for shared strings so that it can be used to fetch the sharedString index of category axes and removed an unneeded summand when calculating a label's column.
Change Description
Calculating the col and row position of the category labels
getExcelColName(idx + 1 + idy)
did not needidx
, and caused each subsequent row of labels to be shifted one more column to the right from the previous row.Calculating the category label indexes in sharedStrings.xml
I could not find a fix for the calculation, so I instead create a key/value object (e.g.
{ 'Category Label': 4 }
) that maps strings to their respective indexes in sharedStrings.xml, and use it to get the correct index of any given string.Other
There is at least one
WIP: FIXME:
note around this code; I did not remove it, as I wasn't sure if the note was referencing this issue in particular.Lastly, I only updated the accessing of shared strings for
IS_MULTI_CAT_AXES
, as I'm not too familiar with the other chart types and I'd risk introducing more bugs. The dictionary object should get correctly populated by all chart types, though.Change Type
Motivation and Context
While the PPTX charts with multiple category axes looked fine, their embedded Excel contained malformed data, and upon opening the Excel, the related chart would also break.
Checklist before requesting a review
/demos/modules/
Screenshots / Sample Code (if appropriate)