人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

php做柱型圖的函數(shù)

php做柱型圖的函數(shù)

更新時(shí)間:2022-08-27 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

關(guān)鍵詞:PHP

#為了方便起見,我又做了一個(gè)函數(shù)來制作柱型圖
/*參數(shù)說明:
$graphdata:百分比數(shù)據(jù)(y軸)
$label:x軸標(biāo)題
$data:實(shí)際數(shù)據(jù)(y軸)
$graphwidth:圖像寬度
$graphheight:圖像高度
$graphscale:高度因子(為$graphheight/100)
$graphfont:字體號
$bg;背景顏色值
$text:文本顏色值
$grid:邊線顏色值
$bar:柱的顏色值
$bz:備注(不支持中文呀)
*/
function timage(
$graphdata,$label,$data,
$graphwidth,$graphheight,$graphscale,$graphfont,
$bg,$text,$grid,$bar,$bz)
{

header("Content-type:image/gif");
$image=imagecreate($graphwidth+50,$graphheight+50);
$bgcolor= imagecolorallocate ($image ,$bg[0],$bg[1],$bg[2]);
$textcolor= imagecolorallocate ($image ,$text[0],$text[1],$text[2]);
$gridcolor=imagecolorallocate ($image ,$grid[0],$grid[1],$grid[2]);
$barcolor=imagecolorallocate ($image ,$bar[0],$bar[1],$bar[2]);
$gridabelwidth=imagefontwidth($graphfont)*3+1;
$gridableheight= imagefontheight ($graphfont);
imageline($image,$gridlabelwidth,0,$gridlabelwidth,$graphheight-1,$gridcolor);
imageline($image,0,$graphheight-1,$graphwidth-1,$graphheight-1,$gridcolor);
for($i=0;$i<$graphheight;$i+=$graphheight/10)
{
imagedashedline ($image,0,$i,$graphwidth-1,$i,$gridcolor);
imagestring($image,$graphfont,0,$i,round(($graphheight-$i)/$graphscale),$textcolor);
}

$barwidth=(($graphwidth-$gridlabelwidth)/count($graphdata))-30;#&iquest;&Oslash;&Ouml;&AElig;&Ouml;ù&micro;&Auml;×&Uuml;&iquest;í&para;&Egrave;
for($i=0;$i {
$bartopx=$gridlabelwidth+(($i+1)*20)+($i*$barwidth);#&iquest;&Oslash;&Ouml;&AElig;&Ouml;ù&iquest;&iquest;×ó&micro;&Auml;&frac34;à&Agrave;&euml;
$barbottomx=$bartopx+$barwidth;
$barbottomy=$graphheight-1;#&iquest;&Oslash;&Ouml;&AElig;&Ouml;ù&micro;&Auml;&Iuml;&Acirc;±&szlig;&frac12;&ccedil;
$bartopy=$barbottomy-($graphdata[$i]*$graphscale);
imagefilledrectangle($image,$bartopx,$bartopy,$barbottomx,$barbottomy,$barcolor);
$labelx1=$bartopx;
$labely1=$bartopy-15;
$labelx2=$bartopx;
$labely2=$graphheight;
imagestring($image,$graphfont,$labelx1,$labely1,"$graphdata[$i]"."%",$textcolor);
imagestring($image,$graphfont,$labelx2,$labely2,"$label[$i]",$textcolor);
imagestringup ($image,$graphfont,$labelx1+10,$labely1-$gridableheight,"$data[$i]",$textcolor);
}
imagestring($image,$graphfont,1,$graphheight+30,$bz,$textcolor);
imagegif ($image);

}
?>

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 鹤庆县| 吴旗县| 林芝县| 黄陵县| 五家渠市| 鹤壁市| 贵南县| 临潭县| 大英县| 探索| 平昌县| 八宿县| 措美县| 舒兰市| 岢岚县| 平利县| 同仁县| 金湖县| 高密市| 南澳县| 栾川县| 虹口区| 揭西县| 蓬安县| 平远县| 金昌市| 原阳县| 海丰县| 广昌县| 包头市| 浙江省| 佛教| 东宁县| 焦作市| 莫力| 资中县| 林甸县| 土默特右旗| 清丰县| 扎兰屯市| 常德市|