Forum


Replies: 6   Views: 2203
How to set up line chart without curve when created from a template
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 vrietz  · 20-11-2019 - 10:46

Hello,
I have the exact same problem.

When I create a doc file from scratch, my graph looks alright. But when I create a doc from a template, my graph looks different (it has curves, the colors are different, the axis too) . See the code below:

//...
$paramsChart = array(
                    'data' => $data,
                    'type' => 'lineChart',
                    'color' => '2',
                    'chartAlign' => 'center',
                    'showTable' => 1,
                    'sizeX' => '15',
                    'sizeY' => '10',
                    'legendPos' => 'b',
                    'legendOverlay' => '0',
                    'haxLabel' => 'Time',
                    'vaxLabel' => 'Number',
                    'haxLabelDisplay' => 'horizontal',
                    'vaxLabelDisplay' => 'vertical',
                    'hgrid' => '1',
                    'vgrid' => '0',
                    'symbol' => 'circle',
                    'smooth' => false,
                );
// first document
$docx1 = new CreateDocx();
$docx1->addChart($paramsChart);
// second document
$docx2 = new CreateDocxFromTemplate('path_to_file.docx');
$docx2->addChart($paramsChart);

I don't know what I'm doing wrong, please help.

I use PHPdocX 7.5