Hi I have just loaded a xlsx file with graph,but the graph is not displayed in output.
This is my code :
$objPHPExcel=$objPHPExcel_new = new PHPExcel();
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcel = $objReader->load("../Graph_sample.xlsx");
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('result.xlsx');
Because most users don't want to load charts by default (loading/saving charts is a speed and memory overhead), you have to explicitly tell PHPExcel that you want to load them using setIncludeCharts()
:
$objPHPExcel=$objPHPExcel_new = new PHPExcel();
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objReader->setIncludeCharts(TRUE);
$objPHPExcel = $objReader->load("../Graph_sample.xlsx");
and when writing
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->setIncludeCharts(TRUE);
$objWriter->save('result.xlsx');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With