->BORDER+10,10,$color); ImageLine($this->IMAGE,$rulerX,$this->Y-$this->BORDER,$rulerX,$this->Y-$this->BORDER+2,$color); } }
//--------------竖柱形图 function imageColumnS(){ $item_array=Split($this->ARRAYSPLIT,$this->ITEMARRAY); $num=Count($item_array); $item_max=0; for ($i=0;$i<$num;$i++){ $item_max=Max($item_max,$item_array[$i]); } $xx=$this->BORDER*2; //画柱形图 for ($i=0;$i<$num;$i++){ srand((double)microtime()*1000000); if($this->R!=255 && $this->G!=255 && $this->B!=255){ $R=Rand($this->R,200); $G=Rand($this->G,200); $B=Rand($this->B,200); }else{ $R=Rand(50,200); $G=Rand(50,200); $B=Rand(50,200); } $color=ImageColorAllocate($this->IMAGE,$R,$G,$B); //柱形高度 $height=($this->Y-$this->BORDER)-($this->Y-$this->BORDER*2)*($item_array[$i]/$item_max); ImageFilledRectangle($this->IMAGE,$xx,$height,$xx+$this->BORDER,$this->Y-$this->BORDER,$color); ImageString($this->IMAGE,$this->FONTSIZE,$xx,$height-$this->BORDER,$item_array[$i],$this->FONTCOLOR); //用于间隔 $xx=$xx+$this->BORDER*2; } }
//-----------横柱形图 function imageColumnH(){ $item_array=Split($this->ARRAYSPLIT,$this->ITEMARRAY); $num=Count($item_array); $item_max=0; for ($i=0;$i<$num;$i++){ $item_max=Max($item_max,$item_array[$i]); } $yy=$this->Y-$this->BORDER*2; //画柱形图 for ($i=0;$i<$num;$i++){ srand((double)microtime()*1000000); if($this->R!=255 && $this->G!=255 && $this->B!=255){ $R=Rand($this->R,200); $G=Rand($this->G,200); $B=Rand($this->B,200); }else{ $R=Rand(50,200); $G=Rand(50,200); $B=Rand(50,200); } $color=ImageColorAllocate($this->IMAGE,$R,$G,$B); //柱形长度 $leight=($this->X-$this->BORDER*2)*($item_array[$i]/$item_max); ImageFilledRectangle($this->IMAGE,$this->BORDER,$yy-$this->BORDER,$leight,$yy,$color); ImageString($this->IMAGE,$this->FONTSIZE,$leight+2,$yy-$this->BORDER,$item_array[$i],$this->FONTCOLOR); //用于间隔 $yy=$yy-$this->BORDER*2; } }
//--------------折线图 function imageLine(){ $item_array=Split($this->ARRAYSPLIT,$this->ITEMARRAY); $num=Count($item_array); $item_max=0; for ($i=0;$i<$num;$i++){ $item_max=Max($item_max,$item_array[$i]); } //$xx=$this->BORDER; //画柱形图 for ($i=0;$i<$num;$i++){ srand((double)microtime()*1000000); if($this->R!=255 && $this->G!=255 && $this->B!=255){ $R=Rand($this->R,200); $G=Rand($this->G,200); $B=Rand($this->B,200); }else{ $R=Rand(50,200); $G=Rand(50,200); $B=Rand(50,200); } $col |