drawBarChart OverrideColors Problem
Hi,
i try to set own colors with OverrideColors in a Bar Chart.
Code without color setting:
Code:
<?php
include($_SERVER['DOCUMENT_ROOT']."/pchart/class/pData.class.php");
include($_SERVER['DOCUMENT_ROOT']."/pchart/class/pDraw.class.php");
include($_SERVER['DOCUMENT_ROOT']."/pchart/class/pImage.class.php");
$myData = new pData();
$myData->addPoints(array(2,8),"Serie1");
$myData->addPoints(array(4,6),"Serie2");
$myPicture = new pImage(70,30,$myData);
$myPicture->setGraphArea(5,5,65,25);
$myPicture->drawScale($Settings);
$myPicture->drawBarChart($Config);
$myPicture->stroke();
?>
Code with OverrideColors to set own colors:
Code:
<?php
include($_SERVER['DOCUMENT_ROOT']."/pchart/class/pData.class.php");
include($_SERVER['DOCUMENT_ROOT']."/pchart/class/pDraw.class.php");
include($_SERVER['DOCUMENT_ROOT']."/pchart/class/pImage.class.php");
$Palette[0] = array("R"=>0,"G"=>0,"B"=>255,"Alpha"=>100);
$Palette[1] = array("R"=>255,"G"=>0,"B"=>0,"Alpha"=>100);
$myData = new pData();
$myData->addPoints(array(2,8),"Serie1");
$myData->addPoints(array(4,6),"Serie2");
$myPicture = new pImage(70,30,$myData);
$myPicture->setGraphArea(5,5,65,25);
$myPicture->drawScale($Settings);
$Config = array("OverrideColors"=>$Palette);
$myPicture->drawBarChart($Config);
$myPicture->stroke();
?>
Results:first code:
second code (with OverrideColors):
My problem is, how can i colorized in my second sample the 1st and 3rd column in blue and the 2nd and 4th in red ?
Regards, Thiemo