InfoQ

交流

讨论:投票系统的饼图或柱型图如何做,谢谢!

作者 captain 发布于 2003-08-01 分类:php基础编程

有没有谁做好的,谢谢!



逛论坛交流投票系统的饼图或柱型图如何做,谢谢!

加入书签
digg+,
reddit+,
del.icio.us+,
dzone+

5 条回复

回复

将每个人的投票累加,记入库中,但是图.. 发表人 captain 发表于 08月19日
http://ctb.11cn.org/index.php?mo ..... 发表人 xltxlm 发表于 08月19日
谢谢,我回去研究研究! 发表人 captain 发表于 08月19日
php作线形图的函数 关键词:PHP .. 发表人 dong 发表于 08月19日
imagecreate() 为什么我的没有这个.. 发表人 captain 发表于 08月19日
  1. 将每个人的投票累加,记入库中,但是图形如何显示呢?

  2. 谢谢,我回去研究研究!

  3. php作线形图的函数

    关键词:PHP

    /*
    函数说明
    $data:y轴数据(数组)
    $graphdata:y轴数据--百分比(数组)
    $label:x轴数据(数组)
    $height:图像高度
    $width:图像宽度
    $font:字号
    $dot:决定点的大小
    $bg:背景色
    $line :线色
    $text :文本色
    $dotcolor:点色
    $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);
    }
    ?>

  4. imagecreate()
    为什么我的没有这个函数呢?




  5. 我有话要讲:(可以匿名发表, 发广告的有多远请滚多远!!!)

    昵称: 请输入验证码:


抢着回答

有没人帮我解一道高中的一道数学题?

直线X+Y=1被圆x平方+y平方=4截得的弦长是?

如何将字符串这样换行

比如这样一段字符串: “自动URLs分析: 自动判别网址加上连接代...

在mysql中有和与或的关系怎么写?

在mysql中既有和又有或的关系怎么写?

女记者的愤怒..(图)

why..?

求救阿!~ 中文乱码!

我下载一个搜寻mysql桌程序。但是, 我设法搜寻中文词, 中文不能出...

Top147.com急寻Linux+php+mysql的编程人...

Top147——中文互联网世界中的第一体育运动品牌,全球最大的台球...

如何删除文件中指定的行,急!!!!

我要从文件中根据输入的内容删除一行,请问如何做,例如:test.p...

how to 实现数据库id 字段 自动累加

如题 谢谢 先

你的手有她快吗?  

http://www.superhandz.com/images/cupstackingfini.wmv

新做的本本儿,文本的,第一次用 SESSI...

http://xfus.net/dummy/gbook/ 提提意见哦~~呵呵

[]