Forum


Replies: 1   Views: 2471
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?