I've noticed that pPie draws on transparent background but could not get regular charts with pImage to have transparent backgrounds:
I had to amend the code, and I'm not sure i've done the right thing but here goes.
In pImage
Code:
function pImage($XSize,$YSize,$DataSet = NULL) {
if ( $DataSet != NULL ) { $this->DataSet = $DataSet; }
$this->XSize = $XSize;
$this->YSize = $YSize;
$this->Picture = imagecreatetruecolor($XSize,$YSize);
imagealphablending($this->Picture, false);
$col=imagecolorallocatealpha($this->Picture, 255, 255, 255, 127);
imagefilledrectangle($this->Picture, 0,0,$XSize, $YSize, $col);
imagealphablending($this->Picture,TRUE);
// $C_White = $this->AllocateColor($this->Picture,255,255,255);
// imagefilledrectangle($this->Picture,0,0,$XSize,$YSize,$C_White);
}
...
/* Render the picture to a file */
function render($FileName) {
imagealphablending($this->Picture,false);
imagesavealpha($this->Picture,true);
imagepng($this->Picture,$FileName);
}
as per
this blog entry.
Is there a legit way of doing this without changing pImage?