Forum


Replies: 1   Views: 2462
Document invalid with charts
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 Red Nacional de Refugios  · 17-11-2017 - 07:16

$docx = new CreateDocx();
        $text = 'Phpdocx. Easily create Word and PDF documents online';
        $data = array(
            'data' => array(
                array(
                    'name' => 'Legend 1',
                    'values' => array(20),
                ),
                array(
                    'name' => 'Legend 2',
                    'values' => array(30),
                ),
                array(
                    'name' => 'Legend 3',
                    'values' => array(40),
                ),
            ),
        );
        $paramsChart = array(
            'data' => $data,
            'type' => 'pieChart',
            'sizeX' => 10,
            'sizeY' => 5,
            'chartAlign' => 'center',
        );
        $docx->addChart($paramsChart);
        $docx->addText($text);
        $docx->createDocxAndDownload('tutorial_2s');

 i have this code   so when  i try to download the file is corrupted  can you help me pls?

Posted by admin  · 17-11-2017 - 07:29

Hello,

phpdocx 7.5 added a new data structure for charts, and your license is phpdocx 7.0. Your script is using the data structure of phpdocx 7.5 that can't be used with phpdocx 7.0.

We recommend you to check the samples included in your package in the examples/addChart folder, or upgrade to phpdocx 7.5 on MY PHPDOCX page if you want to use all features added to the latest release of phpdocx (https://www.phpdocx.com/news/post/phpdocx-v7-5-release-notes/213).

Regards.