php使用Jpgraph绘制3D饼状图的方法

yipeiwu_com5年前PHP代码库

本文实例讲述了php使用Jpgraph绘制3D饼状图的方法。分享给大家供大家参考。具体实现方法如下:

<?php 
include ("src/jpgraph.php"); 
include ("src/jpgraph_pie.php"); 
include ("src/jpgraph_pie3d.php"); 
$data = array(19,23,34,38,45,67,71,78,85,87,90,96); 
$graph = new PieGraph(400,300); 
$graph->SetShadow(); 
$graph->title->Set("年度收支表"); 
$graph->title->SetFont(FF_SIMSUN,FS_BOLD); 
$pieplot = new PiePlot3D($data); //创建PiePlot3D对象 
$pieplot->SetCenter(0.4); //设置饼图中心的位置 
$pieplot->SetLegends($gDateLocale->GetShortMonth()); //设置图例 
$graph->Add($pieplot); 
$graph->Stroke(); 
?> 

运行效果图如下:

希望本文所述对大家的php程序设计有所帮助。

相关文章

如何使用PHP计算上一个月的今天

一日,遇到一个问题,求上一个月的今天。 最开始我们使用 strtotime(”-1 month”) 函数求值,发现有一个问题,月长度不一样的月份的计算结果有误。 比如:2011-03-3...

php set_time_limit()函数的使用详解

语法 : void set_time_limit (int seconds)说明 : 设定一个程式所允许执行的秒数,如果到达限制的时间,程式将会传回错误。它预设的限制时间是30秒,max...

PHP中CURL方法curl_setopt()函数的参数分享

PHP CURL curl_setopt 参数bool curl_setopt (int ch, string option, mixed value)curl_setopt()函数将为...

php中define用法实例

本文实例讲述了php中define用法。分享给大家供大家参考。具体如下: <?php /* * define * */ /*第3个参数: * false --...

php使用curl模拟多线程实现批处理功能示例

本文实例讲述了php使用curl模拟多线程实现批处理功能。分享给大家供大家参考,具体如下: php模拟多线程用到curl库,这个库很强大,可以做好多事,比如模拟登陆,文件上传/下载,数据...