Replies: 4   Views: 3212
Addtemplatechart params not working
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 liam.whan  · 22-11-2012 - 10:27

Hi There,

I am experiencing some difficulty with the params for addTemplateChart my code is:
[code]$legends = array(
'Confident' => array(10),
'Needs Some Development' => array(30),
'Needs Significant Development' => array(40)

$paramsChart =
'data' => $legends,
'type' => 'pie3DChart',
'title' => 'Capability Areas',
'legendpos' => 'b',
'legendoverlay' => 0,
'border' => 1,
'cornerX' => 20,
'cornerY' => 20,
'cornerP' => 30,
'color' => 2,
'textWrap' => 0,
'sizeX' => 15,
'sizeY' => 15,
'jc' => 'center',
'showPercent' => 0,
'font' => 'Verdana'

$docx->addTemplateChart('CHART', $paramsChart);[/code]

and the output I get in Word is:

my questions are:
1. Why is the Title appearing in the legend overlay,
2. Why is the legend overlay appearing at all 'legendoverlay' is set to 0
3. Why are the percentages showing 'showPercent' is set to 0
4. How do I get the legend to show just the Legend name and the Percent (i.e. 'Confident 50%')

an example of what I am trying to achieve ( and the Word 2010 settings required) is below:


Posted by liam.whan  · 11-04-2013 - 12:13

Any advice?

Posted by liam.whan  · 11-04-2013 - 12:13


I've figured out what I need to do, I just need some advice on which class to edit and where in the class file:

I need to edit the chart.xml file; specifically the contents of <c:dLbls> tag and include the following:
<c:showLegendKey val="1"/><c:showVal val="1"/><c:showCatName val="1"/><c:showSerName val="1"/><c:showPercent val="1"/><c:showBubbleSize val="1"/><c:showLeaderLines val="1"/>

any advice on with Inc file to edit and where?

Thanks in advance!

Posted by admin  · 11-04-2013 - 12:13


We're doing several changes and improvements about charts. I have sent you issue to one of the developers.