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

yipeiwu_com4年前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 获取远程文件大小的3种解决方法

1、使用file_get_contents()复制代码 代码如下:<?php$file = file_get_contents($url);echo strlen($file);?...

在html文件中也可以执行php语句的方法

在apache的conf目录中修改文件httpd.conf。 搜索AddType application/ 找到前面没有#的那条,在下面添加AddType application/x-h...

PHP 面向对象改进后的一点说明第1/2页

先看代码: 复制代码 代码如下:<?php class StrictCoordinateClass { private $arr = array('x' => NU...

基于php常用函数总结(数组,字符串,时间,文件操作)

数组:【重点1】implode(分隔,arr) 把数组值数据按指定字符连接起来例如:$arr=array('1','2','3','4');$str=implode('-',$arr);...

php获取QQ头像并显示的方法

本文实例讲述了php获取QQ头像并显示的方法。分享给大家供大家参考。具体分析如下: 最近看到博客留言的头像有点别扭,因为游客的头像都是同一个头像,看着不是很舒服。虽然现在绝大多数的主题集...