Forum


Replies: 11   Views: 600
Eliminar ceros en gráfica
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 rmartinez  · 25-10-2022 - 15:14

El gráfico lo genero con el método addChart. Algo tal que así:

$data = array(
        'legend' => array('Legend 4', 'Legend 3', 'Legend 2', 'Legend 1'),
        'data' => array(
                array(
                        'name' => 'data 1',
                        'values' => array(10, 0, 0, 0),
                ),
                array(
                        'name' => 'data 2',
                        'values' => array(0, 60, 0, 0),
                ),
                array(
                        'name' => 'data 3',
                        'values' => array(0, 0, 7, 0),
                ),
                array(
                        'name' => 'data 3',
                        'values' => array(0, 0, 0, 22),
                ),
        ),
);

$paramsChart = array(
        'sizeX' => 15,
        'sizeY' => 10,
        'hgrid' => 1,
        'vgrid' => 0,
        'minorUnit' => 0,
        'showValue' => 1,
        'chartAlign' => 'center',
        'legendPos' => 'b',
        'stylesTitle' => [
                'fontSize' => 1100,
                'bold' => true,
        ],
        'data' => $data,
        'type' => 'barChart',
);

$docx->addChart($paramsChart);

Tengo la versión 13 Advanced.

Gracias.

Saludos.