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.
![Lập biểu đồ bằng PHP với PHP Lib Chart 2 Lập biểu đồ bằng PHP với PHP Lib Chart - 3](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-3-1024x576.jpg)
<?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(); ?>
![Lập biểu đồ bằng PHP với PHP Lib Chart 3 Lập biểu đồ bằng PHP với PHP Lib Chart - 2](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-2-1024x576.jpg)
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');
![Lập biểu đồ bằng PHP với PHP Lib Chart 4 Lập biểu đồ bằng PHP với PHP Lib Chart - 1](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-1-1024x576.jpg)
![Lập biểu đồ bằng PHP với PHP Lib Chart 5 Lập biểu đồ bằng PHP với PHP Lib Chart - 4](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-4-1024x576.jpg)
![Lập biểu đồ bằng PHP với PHP Lib Chart 6 Lập biểu đồ bằng PHP với PHP Lib Chart - 5](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-5-1024x576.jpg)
![Lập biểu đồ bằng PHP với PHP Lib Chart 7 Lập biểu đồ bằng PHP với PHP Lib Chart - 6](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-6-1024x576.jpg)
![Lập biểu đồ bằng PHP với PHP Lib Chart 8 Lập biểu đồ bằng PHP với PHP Lib Chart - 7](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-7-1024x576.jpg)
![Lập biểu đồ bằng PHP với PHP Lib Chart 9 Lập biểu đồ bằng PHP với PHP Lib Chart - 8](https://www.bienthuy.com/bienthuy-img/2013/12/bien-thuy-php-lib-chart-8-1024x576.jpg)