SourceForge.net  |  Sunyday.net
Last release: 1.27d
a PHP Class to build Charts
pChart 2.x is born, you can start moving your script to this new version. The new website is at www.pchart.net.
Overview  |  Screenshots  |  Download  |  Add-ons  |  Demonstration  |  Support  |  :: Documentation ::
Documentation Contents
Overview
Class definition
FAQ
Using pChart with MySQL
Playing with colors
Setting X labels
Series are drawn black?
Debugging charts
Call to undefined function
Digging with pChart
Basic Examples
Advanced Examples
Series are drawn black?

No, this is not a bug! Series can be drawn as black in at least two circumstances.

You do not have enough colors in your palette

Everything is in the title! Remember, basically pChart embed only colors for 8 series. If you have more than 8 series, you'll need to add colors to you palette. The setColorPalette() is here to help you!
setColorPalette(8,255,0,0);
setColorPalette(9,0,255,0);
setColorPalette(10,0,0,255);
you can also load a color scheme (assuming it contains enough colors!) :
$Test->loadColorPalette('palette.txt');
logical no?

Series descriptions are not set

This bug has been fixed since version 1.27

In order to keep the association between color ID and series in case you are dynamically removing series (when using drawArea() for example) some drawing function needs that all serie have a description. To add a description to one serie, use the SetSerieName() method from the pData class :
$DataSet->SetSerieName("January","Serie1");
$DataSet->SetSerieName("February","Serie2");
$DataSet->SetSerieName("March","Serie3");
not logical, I know.

Last updated on 07/18/2008