PHP Lib Chart is an open source lightweight PHP-based graphing library that creates slick PHP graphs for incorporation into a website or application.
Use:
include('php-lib-chart.php');
Define file to include. Please link to exactly location of the lib file
$graph=new PHPGraphLib(480,320);
This will define width and height of graph: Width: 480, height: 320
$data=array("Jan" => 1145, "Feb" => 1202, "Mar" => 1523, "Apr" => 1437, "May" => 969, "Jun" => 999, "Jul" => 1188, "Aug" => 1188, "Sep" => 888, "Oct" => 1178, "Nov" => 1618, "Dec" => 1358); $data2=array("Jan" => 945, "Feb" => 1002, "Mar" => 1723, "Apr" => 737, "May" => 1369, "Jun" => 1599, "Jul" => 1488, "Aug" => 1688, "Sep" => 1218, "Oct" => 1368, "Nov" => 1259, "Dec" => 1412);
These array will define input data for graph.
You can input maximum of 3 data array. More than this will make graph difficult to see.
<?php /* Lib Chart PHP * Shared by BienThuy.Com * www.BienThuy.Com * wWw.HuyHoa.Com * [email protected] * Yahoo: huyhoa * Skype: admin.vtt * Facebook: https://www.facebook.com/tinhcaviet * Twitter: https://www.twitter.com/tinhcaviet * @ 2013. All Rights Reserved. * */ include('php-lib-chart.php'); $graph=new PHPGraphLib(480,320); $data = array(12124, 5535, 43373, 22223, 60432, 23332, 15544, 24523, 32778, 38878, 28787, 33243, 34832); $graph->addData($data); $graph->setTitle('PHP Lib Chart Demo by BienThuy.Com '); $graph->setGradient('green', 'blue'); $graph->createGraph(); ?>
This is php-lib-chart.php
Note: bieudo.php, bieudo1.php … much be put in the same location with php-lib-chart.php:
include('php-lib-chart.php');