Forum


Replies: 2   Views: 217
Color symbol of line chart
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 deweb  · 12-06-2024 - 08:14

Good morning
I created a lineChart type chart with 2 line series.
The chart works great. However, I try to customize the colors. I can modify the color of the line, but I cannot modify the color of the point (symbol).
I still have a PHP error:

Call to a member function setAttribute() on null

FCPATH/phpdocx/classes/CreateGraphic.php at line 919

I have a premium version and here are my chart settings :
$data = array(
                                'legend' => array('Serie 1', 'Serie 2'),
                                'data' => 
                                        array(
                                                array(
                                                        'name' => '2024',
                                                        'values' => array(42, 31),
                                                ),
                                                array(
                                                        'name' => '2025',
                                                        'values' => array(50, 20),
                                                ),
                                                array(
                                                        'name' => '2026',
                                                        'values' => array(45, 32),
                                                ),
                                                array(
                                                        'name' => '2027',
                                                        'values' => array(48, 34),
                                                ),
                                                array(
                                                        'name' => '2028',
                                                        'values' => array(53, 37),
                                                ),
                                                array(
                                                        'name' => '2029',
                                                        'values' => array(49, 36),
                                                ),
                                                array(
                                                        'name' => '2030',
                                                        'values' => array(54, 28),
                                                ),
                                                array(
                                                        'name' => '2031',
                                                        'values' => array(54, 31),
                                                ),
                                                array(
                                                        'name' => '2032',
                                                        'values' => array(50, 36),
                                                ),
                                                array(
                                                        'name' => '2033',
                                                        'values' => array(47, 24),
                                                ),
                                        ),
                                );
                
                        $paramsChart = array(
                                'data'                  => $data,
                                'type'                  => 'lineChart',
                                'symbol'                => 'dot',
                                'symbolSize'    => 5,
                                'smooth'                => false,
                                'returnChart'   => true,
                                'color'                 => 2,
                                'theme'                 => array(
                                                                         'serRgbColors' => array('00b546','fa7d0f'),
                                                                         'valueRgbColors' => 
                                                                                                array(
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f'),
                                                                                                         array('00b546','fa7d0f')
                                                                                                ),                                                                      
                                                                                        ),
                        );
Thanks for your help
Pierre