<?php
/*
 *  make the multi-line chart
 */ 
 
// include class file
include('plchart.php'); 
   
// set the array of source data
// the first array is the descriptions of x coordinate 
$data = array(
              array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12),
			  "2000" => array(13, 15, 19, 17, 24, 27, 27, 29, 32, 24, 22, 25),
			  "2001" => array(23, 24, 26, 25, 19, 16, 19, 16, 27, 24, 19, 20),
			  "2002" => array(16, 18, 18, 21, 16, 14, 18, 28, 15, 19, 23, 22),
			  "2003" => array(14, 16, 12, 23, 17, 22, 21, 28, 25, 26, 23, 27)
			 );

// set chart object
$chart = new plchart(); 

//echo var_dump($data["2000"]);
for ($i=0;$i<count($data["2000"]);$i++) {
	$data["2000"][$i]=$data["2000"][$i]*rand();
}
   
// set bgcolor
$chart->setbgcolor(255,255,255);    

// set string for title
$title = <<< string
PHP Light Chart v0.060915    Multi-Line
string;

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

// set description
$chart->setdesc(650, 100, 100, 300, 0, 10, 0, 'fonts/arial.ttf', 0, 0, 0);
     
// set graphics
$chart->setgraphics(0, 100, 600, 300, 20, 0.05);
    
// output chart
$chart->outputchart();    

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