thinkphp 3.2.2整合Jpgraph插件
thinkphp 3.2.2整合Jpgraph插件。
1、首先在Jpgraph官网下载一个Jpgraph插件包。
2、把Jpgraph插件包复制到Thinkphp/Library/Vendor/Jpgraph文件夹下(小编习惯把插件放到Thinkphp扩展文件夹里) //画图案例<br>
public function draw3D(){<br>
vendor('Jpgraph.Chart');<br>
$chart = new \Chart;<br>
<br>
$title = '3D饼图'; //标题<br>
$data = array(20,27,45,75,90,10,20,40); //数据<br>
$size = 140; //尺寸<br>
$width = 800; //宽度<br>
$height = 500; //高度<br>
$legend = array('aaaa ','bbbb','cccc','dddd ','eeee ','ffff ','gggg ','hhhh ');//说明<br>
// $chart->create3dpie($title,$data,$size,$height,$width,$legend);<br>
<br>
$title = '柱状图'; //标题<br>
$data = array(20,27,45,75,90,10,80,100); //数据<br>
$size = 140; //尺寸<br>
$width = 750; //宽度<br>
$height = 350; //高度<br>
$legend = array('aaaa ','bbbb','cccc','dddd ','eeee ','ffff ','gggg ','hhhh ');//说明<br>
$chart->createcolumnar($title,$data,$size,$height,$width,$legend);<br>
<br>
/* $title = '柱状图'; //标题<br>
$data = array(20,27,45,75,90,10,80,100); //数据<br>
$size = 140; //尺寸<br>
$width = 750; //宽度<br>
$height = 350; //高度<br>
$legend = array('aaaa ','bbbb','cccc','dddd ','eeee ','ffff ','gggg ','hhhh ');//说明<br>
$chart->createmonthline($title,$data,$size,$height,$width,$legend);*/<br>
<br>
/* $title = '柱状图'; //标题<br>
$data = array(20,27,45,75,90,10,80,100); //数据<br>
$size = 140; //尺寸<br>
$width = 750; //宽度<br>
$height = 350; //高度<br>
$legend = array('aaaa ','bbbb','cccc','dddd ','eeee ','ffff ','gggg ','hhhh ');//说明<br>
$chart->createring($title,$data,$size,$height,$width,$legend);<br>
<br>
$title = '柱商务图'; //标题<br>
$subtitle = '2012 年6月';<br>
$data = array(20,27,45,75,90,100,80,100,300,500,1000,200,300,100,400,600); //数据<br>
$size = 140; //尺寸<br>
$width = 750; //宽度<br>
$height = 350; //高度<br>
$legend = array('张三1','张三2','张三3','张三4','张三5','张三6','张三7','张三8');//说明<br>
$chart->createhorizoncolumnar($title,$subtitle,$data,$size,$height,$width,$legend); <br>
*/<br>
}
详细的整合方法请查看http://www.jb100.net/html/content-28-163-1.html
AD:真正免费,域名+虚机+企业邮箱=0元