Login Register Wishes Forum About
Miscellaneous » Color schemes
Help topics
Latest updates
4669d  replaceImageMapTitle
4669d  replaceImageMapValues
4669d  createFunctionSerie
4669d  setAbsicssaPosition
4669d  negateValues
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
Color schemes

A color scheme is a set of colors that will be applied to your data series in order to make them visually different.

When you download the pChart library, some color schemes are included. In the simplest way of working, you don‘t need to load a color scheme in your script as a default one is already included in the library itself, so no need of external palettes. You‘ll see here the list of the bundled schemes :

"Light" color set

File name : light.color

"Summer" color set

File name : summer.color

"Evening" color set

File name : evening.color

"Autumn" color set

File name : autumn.color

"Spring" color set

File name : spring.color

"blind" color set

File name : blind.color

"Kitchen" color set

File name : kitchen.color

"Navy" color set

File name : navy.color

"Shade" color set

File name : shade.color

What is a color scheme

A color scheme is a text file containing a list of colors. Colors are composed of their Red, Green, Blue and Alpha properties. To create your own color scheme, just create a CSV file using a coma as delimiter between the parameters and a carriage return to separate the colors :

How to apply a color scheme to your charts

To apply a color scheme to your chart, you can use the loadPalette function. This function must be called before any charting function.
 /* Create the pData object */
 $MyData = new pData(); 

 /* Populate some data */
 $MyData->addPoints(array(1,2,3,4),"My Serie 1");

 /* Will replace the whole color scheme by the "light" palette */
 $MyData->loadPalette("palettes/light.color", TRUE);

..then draw your charts.
Last updated on 11/04/2009 
by Jean-Damien 
Linked resources
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 415 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.