Hello,
Without updating the version, please edit DocxUtilities.php and go to the replaceChartData method. In this method you can find the following lines:
$chartStructure = $excel->createXlsx('datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx', $charData);
$chartStructure->saveDocx('datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx');
rename('datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx.docx', 'datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx');
replace them by:
$chartStructure = $excel->createXlsx('datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx', $charData);
$chartStructure->saveDocx($this->getTempDir() . '/' . 'datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx');
rename($this->getTempDir() . '/datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx.docx', $this->getTempDir() . '/datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx');
In this same method you need to replace two other lines:
$zip->addFile('datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx', str_replace('../', 'word/', $chartTarget));
by:
$zip->addFile($this->getTempDir() . '/datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx', str_replace('../', 'word/', $chartTarget));
and:
foreach ($chartData as $idChart => $data) {
unlink('datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx');
}
by:
foreach ($chartData as $idChart => $data) {
unlink($this->getTempDir() . '/datos' . str_replace('rId', '', $idCharts[$idChart]) . '.xlsx');
}
The previous changes use the default temp dir to save the XLSX to be added instead of the current folder.
replaceChartData is being improved in the current testing branch to add new features.
Regards.