您的位置:学习中国 推荐教程 PHP编程 正文
原作者:kuku 添加时间:2007-06-02 原文发表:2007-06-02 人气:8 来源:互联网

本文章共2512字,分5页,当前第2页,快速翻页:
 


//$ChartLabel = array("yes", "no"); //数据对应的名称

//确定图形的大小
$ChartWidth = $ChartDiameter + 20;
$ChartHeight = $ChartDiameter + 20 +
(($ChartFontHeight + 2) * count($ChartData));


//确定统计的总数
for($index = 0; $index $#@60; count($ChartData); $index++)
{
$ChartTotal += $ChartData[$index];
}

$ChartCenterX = $ChartDiameter/2 + 10;
$ChartCenterY = $ChartDiameter/2 + 10;


//生成空白图形
$image = imagecreate($ChartWidth, $ChartHeight);

//分配颜色
$colorBody = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$colorBorder = imagecolorallocate($image, 0x00, 0x00, 0x00);
$colorText = imagecolorallocate($image, 0x00, 0x00, 0x00);

$colorSlice = imagecolorallocate($image, 0xFF, 0x00, 0x00);
$colorSlice[] = imagecolorallocate($image, 0x00, 0xFF, 0x00);


//填充背境
imagefill($image, 0, 0, $colorBody);


/*
** 画每一个扇形
*/
$Degrees = 0;
for($index = 0; $index $#@60; count($ChartData); $index++)
{
$StartDegrees = round($Degrees);
$Degrees += (($ChartData[$index]/$ChartTotal)*360);
 

本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 5 - 下一页>>
本页地址
相关文章

PHP中对数据库操作的封装
多php服务器实现多session并发运行
提升PHP速度全攻略
虚拟主机中对PHP的特殊设置
PHP和MySQL开发的8个技巧
SSI使用详解(一)
SSI使用详解(二)
PHP中实现面向对象编程
PHP中通过Web执行C/C++应用程序
PHP安装攻略:安装并配置PHP
用PHP和MySQL保存和输出图片
phpMyAdmin $_REQUEST参数发现SQL注入漏洞
升级PHP5的理由:PHP4和PHP5性能对比
使用php的zlib压缩和解压缩swf文件

相关评论


本文章所属分类:首页 推荐教程 PHP编程   PHP编程