Chart Legend missing after chart is copied

Topics: User Forum
Oct 30, 2014 at 12:17 PM
Hello everyone.
I have problem when copying sheet from template file to my new PhpExcel object. In template file I have charts that I need to copy, so everything works fine and charts are copied, but there is no Legend labels, they are missing. I used ->copy() method and clone, but the problem persists. Below is my code:

$inputFileName = TEMPLATES.'/chartTemplate.xlsx';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$objPHPExcelTemplate = $objReader->load($inputFileName);
$templateSheet = clone $objPHPExcelTemplate->getSheetByName("ChartSheet");
$templateSheetIndex = 4;
$objPHPExcel->addExternalSheet($templateSheet, $templateSheetIndex);

Any suggestions, thanks in advance :)