Replies: 7   Views: 1794
Importchartstyle from example doesn't work?
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by nbiz  · 24-01-2020 - 15:08


Ok thanks for the precision.

I put the chart in a new document  but how can I grab the chart and put it at a specific place in my original document ?

I've tried this.

$docOriginal = new CreateDocxFromTemplate('Original.docx');
$docChart = new CreateDocxFromTemplate('Chart.docx');
$referenceNode = array(
    'type' => 'chart',
    'occurrence' => 1,
$Contents = $docChart ->GetWordContents($referenceNode);
$docOriginal ->replaceVariableByWordFragment(array('MYCHART' => $Contents[0]), array('type' => 'block'));

 i've print_r(Contents) ,he has one key but it's empty .

Can you tell me how to do ?