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

當前位置:雨林木風下載站 > 技術開發(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)下載排行

主站蜘蛛池模板: 久久久久久久九九九九 | 亚洲国产天堂久久九九九 | 国产日韩一区 | 国产在线日本 | 91香蕉在线观看免费高清 | 日批视频网址免费观看 | 国内精品久久久久久久 | 日韩欧美国产中文字幕 | 久草新视觉 | 亚洲成a人v在线观看 | 日日夜夜免费精品视频 | 日本免费中文字幕 | 日韩国产午夜一区二区三区 | 日韩成人在线免费视频 | 中国国产aa一级毛片 | 99国产欧美久久精品 | 涩涩网站在线观看 | 91av欧美| 午夜怡红院 | 中文字幕无线码一区二区三区 | 激情影院在线视频永久观看 | 欧美亚洲综合在线 | 天天摸天天操 | 国产v综合v亚洲欧美 | 福利视频一区二区思瑞 | 中文字幕人成乱码在线观看 | 玖玖福利 | 护士videossexo另类 | 日本一级高清片免费 | 欧美肥老妇做爰视频 | 日韩一级片免费看 | 国产亚洲精品观看91在线 | 日本免费中文字幕在线看 | 大陆一级毛片免费高清 | 国产在线一区二区三区 | 亚洲四虎永久在线播放 | 午夜影视在线视频观看免费 | 国产在线视频在线观看 | 欧美日韩综合网在线观看 | 国产精品私人玩物在线观看 | 国产一二三区精品 |