Location: PHPKode > scripts > eBusiness Charts > ebusiness-charts/test_pie.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test eB/Charts php class</TITLE>
<style type="text/css">
<!--
  .tbhead { color: #000000; font: 15pt  Tahoma, Arial, Helvetica, sans-serif; font-weight: bold  }  
  .label { color: #000000; font: 8pt  Tahoma, Arial, Helvetica, sans-serif; font-weight: bold  }  
  th { color: #000000; font: 15pt  Tahoma, Arial, Helvetica, sans-serif; font-weight: bold  } 
  td { color: #000000; font: 8pt  Tahoma, Arial, Helvetica, sans-serif; font-weight: bold  }  
-->
</style>

</HEAD>
<BODY>
<?
require_once ("class_ebcharts.php");

//////////////////////////////////////////////////////////////
//
// please change YOUR_ID to ID received after registration
//
// if you do not have your ID please get one from
//                                          http://charts.eb-mon.net
//
////////////////////////////////////////////////////////////////

$labels_a='Jan,Feb,Mar,Apr,Maj,Jun,Jul,Avg,Sep';
$data_a='5,16,8,9,11,11,30,25,33';

$labels=array("first","second","third","fourth","fifth");
$da=array(10,20,30,25,28);
$db=array(11,18,26,21,22);

//////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","pie",400,300);
$b->add_value($da,'aaa');
$b->add_label($labels);
$b->set_color_table('#FF6699,#CCFF99,0x993366,0x003399,0x339900,#FFFF66,#FFaa66');
$b->set_explode('0');
$b->set_lab_font('times',10);
$b->draw();
echo "<HR>";

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","pie",400,300);
$b->add_value($data_a,'aaa');
$b->add_label($labels_a);
//$b->set_color_table('#FF6699,#CCFF99,0x993366,0x003399,0x339900,#FFFF66,#FFaa66');
$b->set_explode('0,2');
$b->set_pie(2);
$b->set_img_border(4);
$b->set_lab_font('times',10);
$b->draw();
echo "<HR>";

//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","pie",400,300);
$b->add_value($data_a,'aaa');
$b->add_label($labels_a);
//$b->set_color_table('#FF6699,#CCFF99,0x993366,0x003399,0x339900,#FFFF66,#FFaa66');
$b->set_explode('0,2');
$b->set_pie(2);
$b->set_lab_font('times',12);
$b->set_bg('green');
$b->draw();
echo "<HR>";
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
$b=new chart("YOUR_ID","pie",400,300);
$b->add_value($data_a,'aaa');
$b->add_label($labels_a);
//$b->set_color_table('#FF6699,#CCFF99,0x993366,0x003399,0x339900,#FFFF66,#FFaa66');
$b->set_explode('1,6');
$b->set_pie(2);
$b->set_depth(15);
$b->set_lab_font('times',9);
$b->set_bg('gold');
$b->draw();
echo "<HR>";

?>
</BODY>
</HTML>
Return current item: eBusiness Charts