<?php
/*
 *  make the 2D pie chart
 */ 
 
// include class file
include('plchart.php'); 
   
// set the array of source data
$data = array("Jan" => 20, "Feb" => 12, "Mar" => 14, "Apr" => 12, "May" => 29, "Jun" => 17, "Jul" => 25, "Aug" => 17, "Sep" => 22, "Oct" => 27, "Nov" =>23, "Dec" => 16);
   
// set chart object
$chart = new plchart(); 
   
// set bgcolor
$chart->setbgcolor(255,255,255);    

// set string for title
$title = <<< string
PHP Light Chart v0.060915
2D PIE
string;

// set chartdata
$chart->setchartdata("pie", 0, 800, 600, 100, $data, '');
    
// set title
$chart->settitle($title, 10, 0, 10, 50, 'fonts/arial.ttf', 0, 0, 250);

// set description
$chart->setdesc(500, 100, 100, 200, 0, 8, 0, 'fonts/arial.ttf', 0, 0, 0);
     
// set graphics
$chart->setgraphics(0, 100, 400, 400, 20, 0.2);
    
// output chart
$chart->outputchart();    

// destroy object
unset($chart);
?>
