手册中的例子
<?php
// create image
$image = imagecreatetruecolor(100, 100);// allocate some solors
$white    = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$gray     = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90);
$navy     = imagecolorallocate($image, 0x00, 0x00, 0x80);
$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50);
$red      = imagecolorallocate($image, 0xFF, 0x00, 0x00);
$darkred  = imagecolorallocate($image, 0x90, 0x00, 0x00);// make the 3D effect
for ($i = 60; $i > 50; $i--) {
  imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE);
  imagefilledarc($image, 50, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE);
  imagefilledarc($image, 50, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE);
}imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 45, 75 , $gray, IMG_ARC_PIE);
imagefilledarc($image, 50, 50, 100, 50, 75, 360 , $red, IMG_ARC_PIE);
// flush image
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>  
 

解决方案 »

  1.   

    header("Content-type: image/PNG");
            srand((double)microtime()*1000000);
            $im = imagecreate(50,20);
            $black = ImageColorAllocate($im, 0,0,0);
            $gray = ImageColorAllocate($im, 170,170,170);
            $yellow = ImageColorAllocate($im, 255,255,200);
            imagefill($im,68,30,$yellow);
            //insert 4 inti number
            imagestring($im, 7, 6, 3,ecDecrypt($_GET['authnum'],'12'), $black);        for($i=0;$i<50;$i++){ //&yen;[¤J¤z&Ecirc;&eth;&para;H&macr;&Agrave;
                    imagesetpixel($im, rand()%70 , rand()%30 , $gray);
            }        ImagePNG($im);
            ImageDestroy($im);
      

  2.   

    唉!没有GD呀!有没有其他的用客户端脚本实现的办法,记得ASP中好像有这种客户端实现的办法。不知道有没有PHP的高手写过?不过先谢谢楼上的朋友。
      

  3.   

    http://community.csdn.net/Expert/topic/4463/4463728.xml?temp=.3951685参考
      

  4.   

    呵呵,楼上的好象是说用FLASH在客户端实现是吧?
    也是好办法:)
      

  5.   

    有一个非常专业的函数库: chartdirector, 在php下面使用还是有点不方便,因为不是php源代码,而是dll动态库。通常用php调用GD做的图片我觉得看上去分辨率太低了。
      

  6.   

    兄弟,给你一个,直接用就行
    <script language="JavaScript">function select1_onchange()
    {
    if(select1.value==14)
    {
    mschart1.chartType =select1.value
     paintfx2();
     mschart1.Plot
    }else{
     mschart1.chartType =select1.value
     paintfx1();
     mschart1.Plot
     }
    }
    </script>
    <br>变换图形表现形式
    <SELECT id=select1 name=select1 LANGUAGE=javascript onchange="return select1_onchange()">
    <OPTION value=1>二维直方图</OPTION>
    <OPTION value=0>三维直方图</OPTION>
    <OPTION value=3>二维折线图</OPTION>
    <OPTION value=2>三维折线图</OPTION>
    <OPTION value=5>二维面积图</OPTION>
    <OPTION value=4>三维面积图</OPTION>
    <OPTION value=14>饼图</OPTION>
    </SELECT>
    <table border=2 cellpadding=2 cellspacing=1 width="100%">
      <tbody> 
      <tr bgcolor=#5c77b5> 
        <td><font color=#ffffff      
                      face=arial,helvetica,verdana,lucida,utopia size=3><b> 
          <table border=0 cellpadding=0 cellspacing=0 width="100%">
            <tbody> 
            <tr> 
              <td align=left><font color=#ffffff      
                            face=arial,helvetica,verdana,lucida,utopia      
                            size=3><b>统计分析</b></font></td>
              <td align=right><font color=#ffffff      
                            face=arial,helvetica,verdana,lucida,utopia      
                          size=1></font></td>
              <td align=right></td>
            </tr>
            </tbody> 
          </table>
          </b></font><b><font      
                      size=-1></font></b></td>
      </tr>
      <tr bgcolor=#ffffff> 
        <td bgcolor=#ffffff><font color=#000000      
                      face="ms sans serif,arial,helvetica,verdana,lucida,utopia"      
                      size=1> 
          <center>  <OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"> 
       <PARAM NAME="LPKPath" VALUE="mschart.LPK"> 
      </OBJECT> <object classid=CLSID:3A2B370C-BA0A-11D1-B137-0000F8753F5D 
     
    height=300 id=mschart1 
    style="HEIGHT: 300px; LEFT: 29px;  TOP: 140px; WIDTH: 700px" 
    width=700 CODEBASE="MSCHRT20.ocx#version=6.0">        </object> 
          </center>
          </font></td>
      </tr>
      </tbody> 
    </table>
    <form name=form1 id=form1>
    <input type="hidden" name=cname id=cname value="日报表"><input type="hidden" name=rname id=rname value=2002-2-2>
    <input type="hidden" name=rc_data id=rc_data value=12>
    <input type="hidden" name=cname id=cname value=2002-2-2><input type="hidden" name=rname id=rname value=2002-2-3>
    <input type="hidden" name=rc_data id=rc_data value=24>
    <input type="hidden" name=cname id=cname value=2002-2-3><input type="hidden" name=rname id=rname value=2002-2-4>
    <input type="hidden" name=rc_data id=rc_data value=26>
    <input type="hidden" name=cname id=cname value=2002-2-4><input type="hidden" name=rname id=rname value=2002-2-5>
    <input type="hidden" name=rc_data id=rc_data value=10>
    <input type="hidden" name=cname id=cname value=2002-2-5>
    <input type="hidden" name=rcount id=rcount value=4>  <!--列-->
    <input type="hidden" name=chtitle id=chtitle value="我的统计图" >
    <!--名称-->
    <input type="hidden" name=ccount id=ccount value=1>    
    </form><script language="JavaScript">
    // mschart1.TitleText = "分析统计图";
    </script><script language="JavaScript">
    function paintfx1()
    {
    t=0;
    mschart1.TitleText = document.form1.chtitle.value;
    mschart1.ShowLegend =true;
    mschart1.ColumnCount =document.form1.ccount.value;
    mschart1.RowCount =document.form1.rcount.value;
    for (i=0;i<document.form1.rcount.value;i++)
        {
    for (j=0;j<document.form1.ccount.value;j++)
            {   mschart1.Row=i+1;
                mschart1.Column=j+1;
                if (document.form1.ccount.value>=1)
                    mschart1.ColumnLabel =document.form1.cname(j).value;
                else
                    mschart1.ColumnLabel =document.form1.cname.value;
                if ((document.form1.rcount.value*document.form1.ccount.value)>1)
                    mschart1.Data=document.form1.rc_data(t).value;
                else
                    mschart1.Data=document.form1.rc_data.value;
                t++;
            }
        if (document.form1.rcount.value>1)
            mschart1.RowLabel =document.form1.rname(i).value ;
        else
            mschart1.RowLabel =document.form1.rname.value ;
        }
    }function paintfx2(){
    t=0;
    mschart1.TitleText = document.form1.chtitle.value;
    mschart1.ShowLegend =true;
    mschart1.ColumnCount =document.form1.rcount.value;
    mschart1.RowCount =document.form1.ccount.value;
    for (i=0;i<document.form1.ccount.value;i++)
        {for (j=0;j<document.form1.rcount.value;j++)
            {    mschart1.Row=i+1;
                mschart1.Column=j+1;
                if (document.form1.rcount.value>=1)
                    mschart1.ColumnLabel =document.form1.cname(j+1).value;
                else
                    mschart1.ColumnLabel =document.form1.cname.value;
                if ((document.form1.ccount.value*document.form1.rcount.value)>1)
                    mschart1.Data=document.form1.rc_data(t).value;
                else
                    mschart1.Data=document.form1.rc_data.value;
                t++;
            }
        if (document.form1.rcount.value>1)
            mschart1.RowLabel ='' ;
        else
            mschart1.RowLabel ='' ;
        }
    }paintfx1();
    </script>
    </td>
                        </tr>
                      </table>
      

  7.   

    jpgraph这个很好,可以成基本上大部分格式的图形
    php的,去网上搜一下吧
      

  8.   

    activex就算了。
    用flash是个可行的办法