Forum


Replies: 2   Views: 2770
Is it possible to change names od categories on chart - function replace_data?
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 andrzej.morun  · 19-12-2016 - 20:50

How can I change names od Series and Categories?

In advanced version phpdocx I use bellow code, but only values changes.

I need to change names od X axis. Is it possible?

require_once 'classes/DocxUtilities.inc';

$docx = new DocxUtilities();

$source = 'example_area_chart.docx';
$target = 'example_area_chart_replace_data.docx';

$completedData = array(
    'legend' => array('Seria 1', 'Seria 2', 'Temp'),
    'Marzec' => array(11, 10, 12),
    'Luty' => array(12, 6, 32),
    'Maj' => array(10, 3, 20),
    'Czerwiec' => array(25, 70, 20)
);

$data = array(
0 => $completedData,    
);

$docx->replaceChartData($source, $target, $data);