Skip to content

Keep cell number formats when plotting chart data from a sheet range#1189

Open
kamilkrzywanski wants to merge 1 commit into
apache:trunkfrom
kamilkrzywanski:fix-1007-chart-cell-number-formats
Open

Keep cell number formats when plotting chart data from a sheet range#1189
kamilkrzywanski wants to merge 1 commit into
apache:trunkfrom
kamilkrzywanski:fix-1007-chart-cell-number-formats

Conversation

@kamilkrzywanski

Copy link
Copy Markdown

When chart data is built with fromNumericCellRange and then plot() is called, the series format code in the chart numCache was left empty (and any existing format was cleared). PowerPoint then shows unformatted data labels if they are linked to source, until the embedded workbook is opened in Excel and the cache is refreshed.

This change reads number formats from the cells, uses the first non-blank numeric cell as the series format, and writes a per-point format when it differs. setFormatCode(...) still overrides the series format. Includes a regression test.

Fixes #1007

fromNumericCellRange left formatCode null, so plot() cleared the chart
numCache format and data labels linked to source showed unformatted
values. Read formats from the cells and write them into the cache.

Fixes apache#1007
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.

Bug: the number format is not updated after updating the XSLFChart in the presentation

1 participant