-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Open
Description
I'm trying to modify a template with text and charts. How can I insert chart in my template as text value like this?
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor('TemplateReport.docx');
$categories = array('A', 'B', 'C', 'D', 'E');
$series1 = array(1, 3, 2, 5, 4);
$chart = $section->addChart('doughnut', $categories, $series1);
$chart->getStyle()->setWidth(\PhpOffice\PhpWord\Shared\Converter::inchToEmu(5.5))->setHeight(\PhpOffice\PhpWord\Shared\Converter::inchToEmu(5));
$templateProcessor->setValue('chart', $chart);
$templateProcessor->saveAs('filename.docx);
'TemplateReport.docx' file contains ${chart} string
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Metadata
Metadata
Assignees
Labels
No labels