Spreadsheets calculate some chart sizes incorrectly
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 50
- Forks
- 53
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 1
Description
Sometimes Excel stores a chart with an anchor referencing two cells, creating a rectangular range, plus EMU offsets. This is a CTTwoCellAnchor POI type. Vaadin handles these correctly.
However, SpreadsheetFactory.getAnchorFromParent(XmlObject) copies incorrect code from the POI XSSFDrawing class, which fails to account properly for CTOneCellAnchor and CTAbsoluteAnchor types.
A starting point on their definitions is found in the MS documentation for their common sizing element.
POI bug 61203 has been opened to enhance POI to support these additional anchor types. That should include a public interface to get what Vaadin needs to avoid copying code (which can then persist bugs like this of course).
The current result is a workbook rendered with huge charts incorrectly sized. I have not figured out yet exactly what one must do in Excel to produce a file with these types of anchors, but one of my users did it somehow. I think it is the shape properties:
- Move and size with cells == CTTwoCellAnchor
- Move but don't size with cells == CTOneCellAnchor
- Don't move or size with cells == CTAbsoluteAnchor
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at SpreadsheetFactory.getAnchorFromParent(XmlObject) and compare its anchor handling with POI's XSSFDrawing implementation and the CTOneCellAnchor, CTTwoCellAnchor, and CTAbsoluteAnchor definitions. Use the linked Microsoft sizing documentation and POI bug 61203 as context; done means workbooks with these anchor types render charts at their correct sizes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100