一般的过程:
输出并保存图像 imagedestroy($img_1);//销毁服务器资源?>
下面是我测试制作柱状图的一份实例代码:
=50; $i--){ imagefilledarc($img_1, 100, $i, 100, 50, 0, 35, $darkblue, IMG_ARC_PIE); imagefilledarc($img_1, 100, $i, 100, 50, 35, 75, $darkgary, IMG_ARC_PIE); imagefilledarc($img_1, 100, $i, 100, 50, 75, 360, $darkred, IMG_ARC_PIE); }//在最高层添加纯色层 imagefilledarc($img_1, 100, 50, 100, 50, 0, 35, $blue, IMG_ARC_PIE); imagefilledarc($img_1, 100, 50, 100, 50, 35, 75, $gary, IMG_ARC_PIE); imagefilledarc($img_1, 100, 50, 100, 50, 75, 360, $red, IMG_ARC_PIE);//定义,保存,显示,销毁 header("Content-type: image/png"); imagepng($img_1); imagedestroy($img_1);?> 上面还涉及到一些简单的算法,不是很难,但相对比较麻烦,但其对于数据的动态展现优势是显而易见的。