Home > php教程 > PHP源码 > body text

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

PHP中文网
Release: 2016-05-25 17:05:05
Original
988 people have browsed it

这篇文章主要介绍了php使用Jpgraph绘制3D饼状图的方法,涉及jpgraph使用PiePlot3D创建3D饼状图的技巧,需要的朋友可以参考下

本文实例讲述了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(); 
?>
Copy after login

运行效果图如下:

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template