pie chart (php graph lib) problem !

Posted by gin on Stack Overflow See other posts from Stack Overflow or by gin
Published on 2010-05-31T22:19:01Z Indexed on 2010/05/31 22:23 UTC
Read the original article Hit count: 370

Filed under:
|

i'm using phpgraphlib for creating charts
i tried one of the example of the pie charts ex (with lil bit pf changes) which is :


include('phpgraphlib.php');
include('phpgraphlib_pie.php');
$graph = new PHPGraphLibPie(400, 200);
$data = array("CBS" => 0, "NBC" => 1);
$graph->addData($data);
$graph->setTitle('8/29/07 Top 5 TV Networks Market Share');
$graph->setLabelTextColor('50,50,50'); 
$graph->setLegendTextColor('50,50,50');
$graph->createGraph();
?>

and whether i put
$data = array("CBS" => 0, "NBC" => 1);
or
$data = array("CBS" => 1, "NBC" => 0);
the pie chart have the same color..
shouldn't the whole pie/slice suppose to be colored with some color (i.e. blue) if ("CBS" => 0, "NBC" => 1) , while if ("CBS" => 1, "NBC" => 0) it should be colored with other color (i.e. red)/?
is there any way to fix it?

i would really appreciate any help ,,

© Stack Overflow or respective owner

Related posts about php

Related posts about piechart