久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

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

瀏覽:70日期:2023-12-31 14:56:42
很高興大家對PHP如此的情有獨(dú)鐘! 下面就給大家介紹php作線形圖的函數(shù): /* 函數(shù)說明 $data:y軸數(shù)據(jù)(數(shù)組) $graphdata:y軸數(shù)據(jù)--百分比(數(shù)組) $label:x軸數(shù)據(jù)(數(shù)組) $height:圖像高度 $width:圖像寬度 $font:字號 $dot:決定點(diǎn)的大小 $bg:背景色 $line :線色 $text :文本色 $dotcolor:點(diǎn)色 $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); } ?> 【本文版權(quán)歸作者與奧索網(wǎng)共同擁有,如需轉(zhuǎn)載,請注明作者及出處】;;;;
標(biāo)簽: PHP
主站蜘蛛池模板: 迭部县| 会昌县| 寿阳县| 丽江市| 武威市| 绥棱县| 英德市| 万年县| 闽清县| 阜新| 咸宁市| 永定县| 南开区| 林甸县| 盐池县| 卢氏县| 特克斯县| 安阳市| 韩城市| 辽阳县| 平远县| 舒兰市| 云浮市| 巴林左旗| 陆河县| 波密县| 阿拉尔市| 金沙县| 安宁市| 永德县| 贡嘎县| 田东县| 炉霍县| 建始县| 蕉岭县| 聊城市| 托克逊县| 安化县| 宣城市| 若羌县| 县级市|