Hello,
Please check the following sample included in the package: examples/Core/addChart/sample_18.php that sets custom colors for a pie chart, you can customize them setting valueRgbColors (as pie charts use a single serie with values instead of mutiple series with values) in the same order than the values have been added:
$data = array(
    'data' => array(
        array(
            'name' => 'data 1',
            'values' => array(10),
        ),
        array(
            'name' => 'data 2',
            'values' => array(20),
        ),
        array(
            'name' => 'data 3',
            'values' => array(50),
        ),
        array(
            'name' => 'data 4',
            'values' => array(25),
        ),
    ),
);
$paramsChart = array(
    'data' => $data,
    'type' => 'pieChart',
    'color' => 3,
    'sizeX' => 10,
    'sizeY' => 5,
    'chartAlign' => 'center',
    'theme' => array(
        'valueRgbColors' => array(
            array('99C099', '678CB3', 'ACA42E'),
        ),
    ),
);
$docx->addChart($paramsChart);Using a Premium license, in this same folder (Core/addChart) you can find 21 samples that illustrate how to use options of the addChart method.
Regards.
 
                 Log in
                                    Log in
                                 Contact
                                Contact
                             Forum
                                Forum