![]() |
Miscellaneous » Color schemes
|
|
Latest updates
Toolbox
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 :
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 : 239,210,121,100 149,203,233,100 2,71,105,100 175,215,117,100 44,87,0,100 222,157,127,100 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.
© 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,02 seconds. Wiki revision 1.37.
|