当先锋百科网

首页 1 2 3 4 5 6 7

一、JPGraph是什么

  1.JPGraph是一个专门提供图表的类库

  2.需要从官网下载http://jpgraph.net/download/


二、如何使用

  1.引入基类jpgraph.php

  2.引入需要使用的功能类


三、示例

  1.饼状图

 1 <?php
 2     include_once("jpgraph/jpgraph.php");
 3     include_once("jpgraph/jpgraph_pie.php");
 4     
 5     $data=array(40,60,21,33,12);
 6     
 7     $graph=new PieGraph(300,300);
 8     $graph->SetShadow();
 9     
10     $graph->title->Set("'Sand' Theme");
11     $graph->title->SetFont(FF_FONT1,FS_BOLD);
12     
13     $p1=new PiePlot($data);
14     $p1->SetTheme("sand");
15     $p1->SetCenter(0.5,0.55);
16     $p1->value->Show(false);
17     
18     $graph->Add($p1);
19     $graph->Stroke();
20 ?>
View Code

 

 

转载于:https://www.cnblogs.com/weiheli/archive/2013/06/14/3132890.html