Replies: 1   Views: 1862
More on 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 Siegfried  · 11-09-2019 - 12:42

hello supportteam,

currently I have to add some charts to my document and I have 3 questions on which I didn't find an answer in the forum respective the API documentation.


1. For me it is very important to give each data-element of a pie- oder bar-chart a seperate color which I read from a database. Is there a way to do it like the following codesample illustrates (which maybe overules the color-property of the addChart-parameters)

If there is no way yet, would it be possible to add this as a feature in a later version of phpdocx?

$data = array(
    'data' => array(
            'name' => 'Legend 1',
            'values' => array(20),
            'color' => 'ff0000',
            'name' => 'Legend 2',
            'values' => array(30),
            'color' => '00ff00',        
            'name' => 'Legend 3',
            'values' => array(40),
            'color' => '0000ff',

2. Is it possible to style the font of the legend (which font, size, color, attributes like bold, italic) ? The size is very important for me because of people with vision impairment.

3. Which are the possible Values for the formatCode - property of the addChart() - method? I didn't find any description or samples.

thanks in advance