Forum


Replies: 1   Views: 2351
Replacechartdata - old data still editable
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 jim.alexander@fundingbenchmarks.org  · 04-11-2017 - 11:27

Hi,

I have a very simple bar chart and use replaceChartData to replace data in this chart.

The resultant output file shows the chart with the replaced data, all good, BUT,  if I open the output file, then "edit data" in that chart, the old data  from the original source file replaces the new data.

i.e. right click on chart->edit data , shows the old chart data from the original docx file ?

Thanks.

 

Posted by admin  · 04-11-2017 - 18:51

Hello,

The current version of the replaceChartData method updates the DOCX values but not the XLSX values. So if you edit the values of the chart, the old values replace the data.

You could use the addChart method with a WordFragment to add an editable chart to a document created from scratch or using a template.

Updating the XLSX is a work in progress and it's in beta stage; if you want to test the beta version of the replaceChartData method, please send to contact[at]phpdocx.com if you are using the classic or namespaces package and the DOCX with the chart you are trying to replace and we'll send you the new file and a script to illustrate how to use it.

Regards.