麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
谁能给我解释一下下面的代码
悬赏分:20 - 2007年06月01日

$data=array(11,20,30,50, 50, 20,20,);
for ($i=0;$i $amount=$amount + $data[$i];
}
for ($i=0;$i $graphdata[$i]=ceil($data[$i]/$amount*100);
}
$label=array("mon","tur","wed","thu","fri","sat","sun");

$width=700;
$height=300;
$jc=$height/100;
$font=3;
$bg=array(0xff,0xff,0xff);
$text=array(0x00,0x00,0x00);
$grid=array(0xbb,0xbb,0xbb);
$bar=array(0xff,0x00,0x00);
$bz="dell sold table ";
timage($graphdata,$label,$data,$width,$height,$jc,$font,$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;
for($i=0;$i $bartopx=$gridlabelwidth+(($i+1)*20)+($i*$barwidth); $barbottomx=$bartopx+$barwidth;
$barbottomy=$graphheight-1;
$bartopy=$barbottomy-($graphdata[$i]*$graphscale);
imagefilledrectangle($image,$bartopx,$bartopy,$barbottomx-50,$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);
}

提问者:bluezsh   06-01 10:10
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
0 + 94 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM