Forum


Replies: 3   Views: 3070
Color scheme for graphs
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 dev@ram  · 03-04-2017 - 17:26

I am trying to change the color of the bar charts to Monochromatic Palette 5 that we see in word. I see in the doc

https://www.phpdocx.com/api-documentation/word-content/add-chart-Word-document-with-PHP

  • 1: greyscale
  • 2: default Word color scheme for charts
  • 3: blue scheme
  • For the remaining color schemes (up to 48) check the Word interface

Where can I see the rest of the definitions ? I saw its called Color 9 but changing it to 9 made it grey. How do I get the correct number for the Monochromatic Palette 5 (Blue Gradient) ?

Thanks in advance.

-Vinu

 

Posted by admin  · 03-04-2017 - 17:48

Hello,

Scheme colors may vary based on the DOCX. You can see the style number to be used in the Design tab, putting the mouse over each style until you see the style name.

The style 9 is grey in the included base template. You can use your own base template or open the base template to get default styles. Styles 7, 15, 23 are blue schemes in the default template included in phpdocx.

Regards.

Posted by dev@ram  · 04-04-2017 - 15:28

Thank you for the info but is there a style that matches the one in the sample link

https://drive.google.com/file/d/0B1elr02Qw0QkZUZPc1Y4akFMTk0/view?usp=sharing

I went through all 48 color settings but none looks like the one got. Any idea how a color scheme like that can be generated?

Posted by admin  · 04-04-2017 - 16:07

Hello,

phpdocx 9.5 Premium licenses include options to customize series and values colors using addChart.

That scheme color is quite similar to Style 3 of phpdocx base template. The only option available to set colors with the addChart method is using the color option.

If you are using MS Word 2016 and you need to use a scheme or palette from this version of MS Word, we recommend you to use a custom empty base template and the CreateDocxFromTemplate class. Using this custom base template you can use the schemes from MS Word 2016: Style 7 is a blue style using this DOCX version.

Advanced and Premium licenses also include this function:

https://www.phpdocx.com/api-documentation/docxutilities/replace-chart-data-Word-document

to create custom charts and change their values dynamically. This method allows to customize Word charts in templates, and with MultiMerge class merge the charts in other DOCX.

Regards.