View unanswered posts | View active topics It is currently Sat Apr 27, 2024 3:52 pm



Reply to topic  [ 2 posts ] 
drawBarChart OverrideColors Problem 
Author Message
New pChart user
New pChart user
User avatar

Joined: Thu Mar 22, 2012 12:43 pm
Posts: 3
Post 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:
Image
second code (with OverrideColors):
Image

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


Thu Mar 22, 2012 1:26 pm
Profile ICQ WWW
New pChart user
New pChart user
User avatar

Joined: Thu Mar 22, 2012 12:43 pm
Posts: 3
Post Re: drawBarChart OverrideColors Problem
Has nobody any idea how can i fix it ? I try to solve this prob since few days.


Wed Mar 28, 2012 10:25 am
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: Google [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron