首页 > php教程 > PHP源码 > 正文

php画图绘图插件libchart使用例子

WBOY
发布: 2016-06-08 17:22:23
原创
1464 人浏览过

libchart是一个非常不错的绘图插件了,可以绘制出如有,饼状,线状,横柱,竖柱图等等,下面本文章就来给各位 分享几个libchart的例子,希望对各位同学会有所帮助。


ibchart可以让我们生成简洁美观大方的图片

采用gd库,不用生成FLASH


php画图绘图插件libchart使用例子

php画图绘图插件libchart使用例子

 
代码比较简单,以致于太多的解释都是多余的
 代码如下 复制代码


include "../libchart/classes/libchart.php";

$chart = new VerticalBarChart();

$dataSet = new XYDataSet();
$dataSet->addPoint(new Point("Jan 2005", 273));
$dataSet->addPoint(new Point("Feb 2005", 421));
$dataSet->addPoint(new Point("March 2005", 642));
$dataSet->addPoint(new Point("April 2005", 800));
$dataSet->addPoint(new Point("May 2005", 1200));
$dataSet->addPoint(new Point("June 2005", 1500));
$dataSet->addPoint(new Point("July 2005", 2600));
$chart->setDataSet($dataSet);
 
$chart->setTitle("Monthly usage for www.111cn.net");
$chart->render("generated/demo1.png");
?>
 
Vertical bars chart
 代码如下
复制代码
 
 <script>ec(2);</script> include "../libchart/classes/libchart.php";<🎜>  <🎜> $chart = new VerticalBarChart();<🎜>  <🎜> $dataSet = new XYDataSet();<🎜> $dataSet->addPoint(new Point("Jan 2005", 273)); $dataSet->addPoint(new Point("Feb 2005", 421)); $dataSet->addPoint(new Point("March 2005", 642)); $dataSet->addPoint(new Point("April 2005", 800)); $dataSet->addPoint(new Point("May 2005", 1200)); $dataSet->addPoint(new Point("June 2005", 1500)); $dataSet->addPoint(new Point("July 2005", 2600)); $chart->setDataSet($dataSet);   $chart->setTitle("Monthly usage for www.111cn.net"); $chart->render("generated/demo1.png"); ?>   Vertical bars chart 官方网站,类包下载。 http://naku.dohcrew.com/libchart/pages/introduction/
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门推荐
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板