码迷,mamicode.com
首页 > Web开发 > 详细

php实现报表(jpgraph插件实现)

时间:2014-05-23 00:36:41      阅读:350      评论:0      收藏:0      [点我收藏+]

标签:php实现报表jpgraph插件实现

jpgraph的安装和配置

1,官网下载  文件包

2,解压  文件包

3,拷贝到你的开发环境下----注意的是:把src目录的所有其他文件 全部剪切到Examples文件内,在剪切是在Examples内建立jpgraph文件夹(名字一定得是jpgraph,因为其功能文件引用都是这个文件名为准)

      只留下docportal    和    Examples  这个2个文件即可

4,执行你本地的环境---即可看见所有的jpgraph案例:http://localhost/Bbiao/jpgraph/Examples/


jpgraph支持语言文件   --------   jpgraph_ttf.inc.php

// Chinese font
define("FF_SIMSUN",30);
define("FF_CHINESE",31);
define("FF_BIG5",32);



比如:

<?php
require_once (‘jpgraph/jpgraph.php‘);
require_once (‘jpgraph/jpgraph_bar.php‘);

$datay1=array(13,8,19,7,17,6);
$datay2=array(40,5,2,7,5,25);

// Create the graph.
$graph = new Graph(350,250);
$graph->SetScale(‘textlin‘);
$graph->SetMarginColor(‘white‘);

// Setup title
$graph->title->Set(iconv("UTF-8","GB2312//IGNORE","咋地三炮,我要支持中文!")) ;   //支持中文标题
$graph->title->SetFont(FF_SIMSUN,FS_BOLD,14);
// Create the first bar
$bplot = new BarPlot($datay1);
$bplot->SetFillGradient(‘AntiqueWhite2‘,‘AntiqueWhite4:0.8‘,GRAD_VERT);
$bplot->SetColor(‘darkred‘);

// Create the second bar
$bplot2 = new BarPlot($datay2);
$bplot2->SetFillGradient(‘olivedrab1‘,‘olivedrab4‘,GRAD_VERT);
$bplot2->SetColor(‘darkgreen‘);

// And join them in an accumulated bar
$accbplot = new AccBarPlot(array($bplot,$bplot2));
$graph->Add($accbplot);

$graph->Stroke();
?>

既可实现php报表需求!




php实现报表(jpgraph插件实现),布布扣,bubuko.com

php实现报表(jpgraph插件实现)

标签:php实现报表jpgraph插件实现

原文地址:http://blog.csdn.net/leyangjun/article/details/26485973

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!