最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

php報表之jpgraph柱狀圖實例代碼

 更新時間:2011年08月22日 23:30:12   作者:  
jpgraph是php中一個非常非常強大的第三方報表工具,據(jù)說能完成一切你想要的圖形
新手初識jpgraph肯定會遇到各種各樣的問題,比如亂碼什么的,本案例是jpgraph3.0.7制作,也經(jīng)過本人的多次實驗,解決亂碼問題
復(fù)制代碼 代碼如下:

<?php
$datay=array(); //縱坐標(biāo)數(shù)據(jù)
$datax=array(); //橫坐標(biāo)數(shù)據(jù)
foreach ($usernums as $key => $value){
$datay[] = $value;
$datax[] = $userids[$key];
}
require_once (‘jpgraph-3.0.7/jpgraph/jpgraph.php');
require_once (‘jpgraph-3.0.7/jpgraph/jpgraph_bar.php');
// Create the graph. These two calls are always required
$graph = new Graph(800,600); //圖像高寬
$graph->SetScale(“textlin”);
$graph->xaxis->SetTickLabels($datax);
$graph->xaxis->SetFont(FF_VERDANA,FS_NORMAL,10);
$graph->xaxis->SetLabelAngle(30);
$graph->yaxis->scale->SetGrace(20);
$graph->xaxis->scale->SetGrace(20);
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->img->SetMargin(40,30,20,40);
// Create a bar pot
$bplot = new BarPlot($datay);
// Adjust fill color
$bplot->SetFillColor(‘orange');
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD,10);
$bplot->value->SetAngle(45);
$bplot->value->SetFormat(‘%d');
$graph->Add($bplot);
// Setup the titles
$graph->title->Set(iconv(“UTF-8″, “gb2312″,”用戶消費報表圖”));
$graph->xaxis->title->Set(iconv(“UTF-8″, “gb2312″,”用戶姓名”));
$graph->yaxis->title->Set(iconv(“UTF-8″, “gb2312″,”用戶訂單數(shù)量”));
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);
// Display the graph
$graph->Stroke();
?>

效果圖:

官方網(wǎng)站 http://jpgraph.net/download/  腳本之家下載地址 http://www.fzitv.net/codes/38194.html

相關(guān)文章

最新評論

新昌县| 古田县| 北流市| 博罗县| 财经| 民和| 河池市| 贡嘎县| 涪陵区| 贵州省| 萝北县| 忻城县| 双峰县| 永德县| 邢台县| 九龙县| 襄垣县| 九江市| 柏乡县| 无为县| 嘉黎县| 睢宁县| 鹤壁市| 顺昌县| 宁晋县| 集安市| 饶河县| 徐汇区| 新巴尔虎右旗| 都安| 鸡泽县| 紫阳县| 吴忠市| 铁力市| 容城县| 赤水市| 德令哈市| 宜宾县| 盐池县| 北碚区| 顺平县|