龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

jpgraph.php生成3D饼图

时间:2014-07-22 14:49来源: 作者: 点击:
分享到:
利用php生成图片的方式很多,现在我在这里介绍下我自己用的jpgraph.php,感觉这个插件用起来还不错,就拿出来和大家分享下,大侠们手下留情勿拍砖。至于jpgraph插件自己在网上下一个
利用php生成图片的方式很多,现在我在这里介绍下我自己用的jpgraph.php,感觉这个插件用起来还不错,就拿出来和大家分享下,大侠们手下留情勿拍砖。至于jpgraph插件自己在网上下一个,很多了,哈哈!
public function pietest() {
        require_once ("../src/jpgraph.php");
        require_once ("../src/jpgraph_pie.php");
        require_once ("../src/jpgraph_pie3d.php");
        $data = array(
            24,
            23,
            96,
            18
        );
        $graph = new PieGraph(300, 200);
        $graph->SetShadow();
        $graph->title->Set(mb_convert_encoding("用户消费报表图", "html-entities", "utf-8"));
        $graph->title->SetFont(FF_SIMSUN, FS_BOLD);
        $p1 = new PiePlot3D($data);
        $p1->SetSize(0.5);
        $p1->SetCenter(0.4);
        $p1->SetColor("red");
        $p1->SetLegends($gDateLocale->GetShortMonth());
        $graph->Add($p1);
        $graph->Stroke();
    }
精彩图集

赞助商链接