Chart Test Examples Not Working

Topics: Developer Forum, Project Management Forum, User Forum
Sep 14, 2012 at 12:33 AM

Hello,

I am trying to use PHPExcel to modify a template file that will cause some charts to update. However, I was having some issues with the charts disappearing from the the template file after updating the cells.  Because I was having some issues I decided to give the test examples a go because I thought I was doing something wrong.

However, all of the chart tests listed below do not work.  Except for 33charcreate-column.php

[TXT] 33chartcreate-area.php 13-Sep-2012 19:39 4.6K  
[   ] 33chartcreate-area.xlsx 13-Sep-2012 19:39 8.4K  
[TXT] 33chartcreate-bar-st..> 13-Sep-2012 19:39 4.7K  
[   ] 33chartcreate-bar-st..> 12-Sep-2012 22:20 8.4K  
[TXT] 33chartcreate-bar.php 13-Sep-2012 19:39 4.7K  
[   ] 33chartcreate-bar.xlsx 12-Sep-2012 22:18 8.4K  
[TXT] 33chartcreate-column..> 13-Sep-2012 19:39 5.2K  
[   ] 33chartcreate-column..> 12-Sep-2012 23:17 10K  
[   ] 33chartcreate-column..> 12-Sep-2012 23:45 15K  
[TXT] 33chartcreate-column..> 13-Sep-2012 19:39 4.7K  
[   ] 33chartcreate-column..> 12-Sep-2012 22:50 8.4K  
[TXT] 33chartcreate-line.php 13-Sep-2012 19:39 4.6K  
[   ] 33chartcreate-line.xlsx 12-Sep-2012 22:22 8.4K  
[TXT] 34chartupdate.php 13-Sep-2012 19:39 2.6K  

I am wondering if they are working on your end.  Or if there is something wrong with my setup.  I used the development branch of github for the PHPExcel classes and tests folder.

Thank you for your time.

-Martin

Sep 14, 2012 at 1:25 AM

Also, if the charts are in fact NOT working and can't be fixed easily (or soon) I want to submit an idea for a workaround.

Because PHPExcel currently destroys charts (for me at least) when adding data to a template.  A simple workaround is to use PHPExcel to output raw data to an .xslx or even .csv file.  After this, the original template file uses VBA to automatically (or prompt the user to) import the raw data into the template.

Just figured I would pass this on for anyone who might be struggling with a similar problem.  Even if it might be common sense for most.

Enjoy!

Coordinator
Sep 14, 2012 at 6:34 AM

The chart examples were working until a patch I implemented last week, I'm currently working to fix that.

Your simple fix won't workbecause VBA will not be persisted through a load/save by PHPExcel.

Sep 14, 2012 at 3:27 PM

Alright. Thank you for the update about the charts.

Also I may have been a little unclear.  The workaround will only allow PHPExcel to output raw data (numbers mostly) to a .csv or .xls(x) file.  The template .xlsm file will be untouched by PHPExcel.  The VBA of the .xlsm file will, upon opening, automatically gather data from the file produced by PHPExcel.  This way PHPExcel cannot break any array formulas or charts in the template file.