日本国产亚洲-日本国产一区-日本国产一区二区三区-日本韩国欧美一区-日本韩国欧美在线-日本韩国欧美在线观看

當前位置:雨林木風下載站 > 技術開發(fā)教程 > 詳細頁面

如何用php作線形圖的函數(shù)

如何用php作線形圖的函數(shù)

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

很高興大家對PHP如此的情有獨鐘!
下面就給大家介紹php作線形圖的函數(shù):

/*
函數(shù)說明
$data:y軸數(shù)據(jù)(數(shù)組)
$graphdata:y軸數(shù)據(jù)--百分比(數(shù)組)
$label:x軸數(shù)據(jù)(數(shù)組)
$height:圖像高度
$width:圖像寬度
$font:字號
$dot:決定點的大小
$bg:背景色
$line :線色
$text :文本色
$dotcolor:點色
$file:輸出圖像文件名
*/

function qximage($data ,
$graphdata,
$label ,
$height,
$width ,
$font,
$dot,
$bg,
$line,
$text,
$dotcolor,
$file)
{
$jc=$height/100;
$fontwidth= imagefontwidth ($font);
$fontheight=imagefontheight($font);

$image= imagecreate ($width,$height+20);
$bg= imagecolorallocate($image ,$bg[0],$bg[1],$bg[2]);
$line=imagecolorallocate($image ,$line[0],$line[1],$line[2]);
$text=imagecolorallocate($image ,$text[0],$text[1],$text[2]);
$dotcolor=imagecolorallocate($image ,$dotcolor[0],$dotcolor[1],$$dotcolor[2]);
imageline ($image,0,0,0,$height,$line);
imageline($image,0,$height,$width,$height,$line);
for ($i=1;$i<11;$i++)
{
imagedashedline($image,0,$height - $jc*$i*10 ,$width ,$height -$jc*$i*10 ,$line );
imagestring ($image,$font,0,$height-$jc*$i*10,$i*10,$text);
}
for ($i=0;$i {
#echo $tmp."
";
$x1=(($width-50)/count($data))*($i)+40;
#echo $x1 ."
";
$y1=$height-$graphdata[$i]*$jc;
$x2=$x1;
$y2=$y1+$graphdata[$i]*$jc;
#echo $y1."
";
imagestring($image,$font,$x1,$y1-2*$fontheight,$graphdata[$i]."%(".$data[$i].")",$text);
imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor);
imagefilltoborder ($image,$x1,$y1,$dotcolor,$dotcolor);
imagestring ($image,$font,$x1,$y2,$label[$i],$text);
if ($i>0)
{
imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line);
}
$tmpx1=$x1;$tmpy1=$y1;
}
imagegif ($image,$file);
}
?>


【本文版權歸作者與奧索網(wǎng)共同擁有,如需轉載,請注明作者及出處】    

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

本類教程下載

系統(tǒng)下載排行

主站蜘蛛池模板: 水蜜桃免费高清视频在线播放 | 快猫视频re06 | 精品日产一区二区三区手机 | 九月婷婷丁香 | 欧美日韩另类综合 | 麻豆手机在线 | 久久国产热视频 | 91av在线免费观看 | 福利一区二区 | 国产成人毛片精品不卡在线 | 国产靠逼视频 | 亚洲精品在线免费看 | 99热精品久久| 国产区小视频 | 乱一色一毛一片 | 欧美视频二区 | 日本一二三区视频 | 97免费视频在线观看 | 日本一级二级三级中文 | 欧美1区二区三区公司 | a级毛片免费高清毛片视频 a级毛片免费观看网站 | 欧美xxxxw| 最新精品国产 | 欧美性猛交xxxxx按摩欧美 | 国产色在线 | 国产区精品高清在线观看 | 蜜桃视频在线播放 | 国产日韩精品视频一区二区三区 | 91精品久久久久久久久中文字幕 | 操bb影院| 青青青在线视频播放 | 亚洲欧美在线观看播放 | 青榴社区视频在线观看免费 | 欧美性猛交xxx免费看人妖 | 黄色片网站日本 | 91一区二区三区 | 国产激情一区二区三区在线观看 | 亚欧成人一区二区 | 日本高清无卡码一区二区久久 | 亚州精品一区中文字幕乱码 | 中国大乳久久 |