您好,欢迎访问一九零五行业门户网

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);
比如:
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报表需求!
其它类似信息

推荐信息