Replies: 17   Views: 3282
Line chart - labels missing
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  · 11-04-2013 - 12:13

Strangely enough, I found that the difference is in using addChart() vs. addTemplate Chart().

A more detailed example:

$colChartValues = array(
'legend' => array('Internet Explorer'),
'January 2011' => array('26.6'),
'February 2011' => array('26.5'),
'March 2011' => array('25.8'),
'April 2011' => array('24.3'),
'May 2011' => array('24.9'),
'June 2011' => array('23.2')

$paramsChart = array(
'data' => $colChartValues,
'type' => 'barChart',
'title' => 'W3C Browser Statistics',
'color' => 2,
'sizeX' => 15,
'sizeY' => 15,
'jc' => 'center',


//$docx->addTemplateChart('CHART', $currentRatioChart); DOES NOT WORK
//$docx->addChart($currentRatioChart); WORKS

Why are those two methods resulting in different charts?

Screenshot 1 shows it when it was added to a template, which contained nothing else but the text $CHART$
Screenshot 2 shows the Chart added in a new docx document