PhpSpreadsheet: 32_Chart_read_write.php corrupted Excel 2013 file wth chart "xl/drawings/drawing1.xml"
This is:
- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)
I try to copy .xlsx file with chart and insert data to this file for this chart. Tried different ways and still when file is saved, I can’t open it successfully because it’s corrupted. How can I fix it?
What is the expected behavior?
Successfully save and open new .xlsx file with my data and chart
What is the current behavior?
The error that Component “xl/drawings/drawing1.xml” is deleted. Don’t understand why my chart became drawing.
What are the steps to reproduce?
I have tried to reproduce the process with the help of ready sample. Sample/32_Chart_read_write.php
Even with this sample, I can’t save not corrupted file with chart.
All code I have from "32_Chart_read_write.php" sample and used 2 my test.xlsx files that contain some date and 1 chart,
Which versions of PhpSpreadsheet and PHP are affected?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 24 (3 by maintainers)
Commits related to this issue
- Name Clashes Between Parsed and Unparsed Drawings This is at least a partial fix for #2396 and #1767 (which has been around for a long time). PhpSpreadsheet renames drawing XML files when it reads th... — committed to oleibman/PhpSpreadsheet by oleibman 3 years ago
- Name Clashes Between Parsed and Unparsed Drawings (#2423) * Name Clashes Between Parsed and Unparsed Drawings This is at least a partial fix for #2396 and #1767 (which has been around for a long t... — committed to PHPOffice/PhpSpreadsheet by oleibman 3 years ago
I can confirm that charts generation seems to be broken. In my case, simply doing this gets a corrupted Xlsx file. If I force open it, the chart is gone.
I have no ideas at the moment. The module where this problem lies is particularly daunting. I am working on it for a different reason right now. My hope is that that work will give greater insight to addressing this. At any rate, I haven’t given up on it.