Forum


Replies: 17   Views: 5012
Custom graph
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 eyalmarkovich  · 08-02-2014 - 00:37

Hi



I am trying to use the example code you provided to create the following graph



http://www.totalapm.com/tmp/graph1.png:



require_once '../../classes/CreateDocx.inc';



$completedData = array(

    'legend' => array('Completed', 'Data', 'Example'),

    'data 1' => array('1', 10, 51),

    'data 2' => array('2', 6, 3),

    'data 3' => array('10', 3, 17),

    'data 4' => array('25', 70, 20)

);



$docx = new DocxUtilities();

$source = "../files/example_line_Chart.docx";

$target = '../docx/example_line_Chart_replace_data.docx';

$data = array(

    0 => $completedData,

    1 => $completedData,

);

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



However, while I see the data being replaced in the graph, the labels are not changed (for example, 'data 1', 'data 2' in your code )



I am also unable to dynamicly control the number of points in the graph.



Please help



Thanks



Eyal