色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php報(bào)表之jpgraph柱狀圖實(shí)例代碼

新手初識(shí)jpgraph肯定會(huì)遇到各種各樣的問(wèn)題,比如亂碼什么的,本案例是jpgraph3.0.7制作,也經(jīng)過(guò)本人的多次實(shí)驗(yàn),解決亂碼問(wèn)題
復(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″,”用戶(hù)消費(fèi)報(bào)表圖”));
$graph->xaxis->title->Set(iconv(“UTF-8″, “gb2312″,”用戶(hù)姓名”));
$graph->yaxis->title->Set(iconv(“UTF-8″, “gb2312″,”用戶(hù)訂單數(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.jb51.NET/codes/38194.html

php技術(shù)php報(bào)表之jpgraph柱狀圖實(shí)例代碼,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 周至县| 佛山市| 福州市| 乌什县| 辉南县| 吉首市| 友谊县| 含山县| 马关县| 昌都县| 哈巴河县| 岫岩| 玛多县| 班戈县| 阿城市| 乃东县| 莱阳市| 新宾| 吴堡县| 凤庆县| 永平县| 闸北区| 南乐县| 韶关市| 广汉市| 保定市| 沿河| 宁都县| 曲阜市| 旅游| 株洲市| 十堰市| 集贤县| 会宁县| 东乡族自治县| 金溪县| 延吉市| 巴青县| 兴和县| 平阳县| 阆中市|