我也要这方面的资料,楼主有消息了发我一份,thanks.

解决方案 »

  1.   

    http://www.aditus.nu/jpgraph/jpdownload.php到上面下载jpgraph里面有详细的例子.php文件你要的统计图绝对没问题
      

  2.   

    呵呵,感谢自己大侠,我自己研究研究,一共画出了条形图,柱形图,立体的柱形图,饼图,折线图共5种,终于勉强过关,完成任务。-----------------------1 恭喜楼主先
    2 画了5种才叫勉强过关,那什么才叫完美完成??----如果不是楼主的BOSS是个超级BT,
    就是楼主是个绝对的完美主义者...
      

  3.   

    也可以用vml来实现,效果非常美观。但是要求客户端浏览器是IE
      

  4.   

    <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
    <!--[if !mso]>
    <style>
    v\:*         { behavior: url(#default#VML) }
    o\:*         { behavior: url(#default#VML) }
    .shape       { behavior: url(#default#VML) }
    </style>
    <![endif]-->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <SCRIPT Language="JavaScript" src="vml.js"></SCRIPT>
    <title>分析图演示</title>
    <style>TD {FONT-SIZE: 9pt}</style>
    </head>
    <body topmargin=5 leftmargin=0>
    <script language=javascript>
    //=============扇形分析图调用方法=====================//扇形区块颜色设置,颜色数目可以大于内容区块数目
    var areaColor1 = new Array();
    areaColor1[0] = "#d1ffd1";
    areaColor1[1] = "#ffbbbb";
    areaColor1[2] = "#ffe3bb";
    areaColor1[3] = "#cff4f3";
    areaColor1[4] = "#d9d9e5";
    areaColor1[5] = "#ffc7ab";
    areaColor1[6] = "#ecffb7";//旁注渐变颜色设置
    var areaColor2 = new Array();
    areaColor2[0] = "#00ff00";
    areaColor2[1] = "#ff3333";
    areaColor2[2] = "#ff9900";
    areaColor2[3] = "#33cccc";
    areaColor2[4] = "#666699";
    areaColor2[5] = "#993300";
    areaColor2[6] = "#99cc00";var tb_color = new Array(areaColor1,areaColor2);var dataArray = new Array();
    dataArray[0] = 200;
    dataArray[1] = 1200;
    dataArray[2] = 900;
    dataArray[3] = 600;
    dataArray[4] = 1222;
    dataArray[5] = 413;
    dataArray[6] = 800;var nameArray = new Array();
    nameArray[0] = "中国";
    nameArray[1] = "美国";
    nameArray[2] = "日本";
    nameArray[3] = "欧洲";
    nameArray[4] = "澳洲";
    nameArray[5] = "南美";
    nameArray[6] = "其它";var total= new Array(nameArray,dataArray);//参数含义(传递的数组,颜色设置数组,横坐标,纵坐标,图表的宽度,图表的高度, 旁边文字框高度,图表的类型)
    //图标类型选A则用旁边文字框说明各部分含义及比例,选B则说明文字用线条指向色块
    sector(total,tb_color,100,40,250,250,30,"A");
    sector(total,tb_color,190,450,250,250,0,"B");//=============柱状图调用方法=====================
    //参数含义(传递的数组,颜色设置数组,横坐标,纵坐标,柱子的厚度,柱子的宽度,图表的宽度,图表的高度,图表的类型)
    histogram(total,tb_color,20,900,20,30,400,200,"A");
    histogram(total,tb_color,20,1200,20,20,400,250,"B");//=============曲线分析图调用方法=====================var nameArray = new Array();nameArray[0] = "Jan";
    nameArray[1] = "Feb";
    nameArray[2] = "Mar";
    nameArray[3] = "Apr";
    nameArray[4] = "May";
    nameArray[5] = "Jun";
    nameArray[6] = "Jul";
    nameArray[7] = "Aug";
    nameArray[8] = "Sep";
    nameArray[9] = "Oct";
    nameArray[10] = "Nov";
    nameArray[11] = "Dec";
    var dataArray1 = new Array();//参数1线条的颜色,参数2线条的宽度,参数3线条的类型,参数4转折点的类型,参数5线条名称
    dataArray1[0] = "#FF0000,1.5,1,2,甲苯";
    dataArray1[1] = 200;
    dataArray1[2] = 1200;
    dataArray1[3] = 900;
    dataArray1[4] = 600;
    dataArray1[5] = 1222;
    dataArray1[6] = 413;
    dataArray1[7] = 800;
    dataArray1[8] = 400;
    dataArray1[9] = 700;
    dataArray1[10] = 550;
    dataArray1[11] = 600;
    dataArray1[12] = 450;var dataArray2 = new Array();dataArray2[0] = "#0000FF,1,2,3,乙醇";
    dataArray2[1] = 400;
    dataArray2[2] = 500;
    dataArray2[3] = 1040;
    dataArray2[4] = 1600;
    dataArray2[5] = 522;
    dataArray2[6] = 813;
    dataArray2[7] = 980;
    dataArray2[8] = 1600;
    dataArray2[9] = 522;
    dataArray2[10] = 813;
    dataArray2[11] = 980;
    dataArray2[12] = 580;
    var dataArray3 = new Array();dataArray3[0] = "#004D00,1,1,3,丙三醇";
    dataArray3[1] = 900;
    dataArray3[2] = 890;
    dataArray3[3] = 1240;
    dataArray3[4] = 1300;
    dataArray3[5] = 722;
    dataArray3[6] = 833;
    dataArray3[7] = 1280;
    dataArray3[8] = 1300;
    dataArray3[9] = 722;
    dataArray3[10] = 833;
    dataArray3[11] = 1280;
    dataArray3[12] = 280;var total = new Array(nameArray,dataArray1,dataArray2,dataArray3);
    //参数含义(传递的数组,横坐标,纵坐标,图表的宽度,图表的高度,折线条数)
    curve(total,20,1500,600,250,3);
    </script>
    </body>
    </html>
      

  5.   

    //饼形图函数
    function sector(total,tb_color,table_x,table_y,all_width,all_height,tb_height,table_type)
    { var total_no = total[0].length;
     var totalpie = 0;
     for(var i=0;i<total_no;i++)
     {
      totalpie += total[1][i];
     }
     var PreAngle = 0;
     for(var i=0;i<total_no;i++)
     { 
      document.write("<v:shape id='_x0000_s1025' alt='' style='position:absolute;left:" + table_x + "px;top:" + table_y + "px;width:" + all_width + "px;height:" + all_height + "px;z-index:1' coordsize='1500,1400' o:spt='100' adj='0,,0' path='m750,700ae750,700,750,700," + parseInt(23592960*PreAngle) + "," + parseInt(23592960*total[1][i]/totalpie) + "xe' fillcolor='" + tb_color[0][i] + "' strokecolor='#FFFFFF'><v:fill color2='" + tb_color[1][i] + "' rotate='t' focus='100%' type='gradient'/><v:stroke joinstyle='round'/><v:formulas/><v:path o:connecttype='segments'/></v:shape>");
      PreAngle += total[1][i] / totalpie;
     }
     
     if(table_type=="A")
     {
      document.write("<v:rect id='_x0000_s1025' style='position:absolute;left:" + (table_x + all_width + 20) + "px;top:" + (table_y + 20) + "px;width:140px;height:" + (total_no * tb_height + 20) + "px;z-index:1'/>");
      for(var i=0;i<total_no;i++)
      {   
       document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x + all_width + 25) + "px;top:" + (table_y+30+(i)*tb_height) + "px;width:60px;height:" + tb_height + "px;z-index:1'>");
       document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>" + total[0][i] + "</td></tr></table></v:textbox></v:shape>");
       document.write("<v:rect id='_x0000_s1040' alt='' style='position:absolute;left:" + (table_x + all_width + 80) + "px;top:" + (table_y + 30 + (i)*tb_height+3) + "px;width:30px;height:20px;z-index:1' fillcolor='" + tb_color[0][i] + "'><v:fill color2='" + tb_color[1][i] + "' rotate='t' focus='100%' type='gradient'/></v:rect>");
       //显示比例数
       document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + (table_x+all_width+110) + "px;top:" + (table_y+30+(i)*tb_height) + "px;width:60px;height:" + tb_height + "px;z-index:1'>");
       document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>" + Math.round(parseFloat(total[1][i]*100/totalpie)*100)/100 + "%</td></tr></table></v:textbox></v:shape>");
      }
     }
     
     if(table_type == "B")
     {
      var pie = 3.14159265358979;
      var TempPie = 0;
      for(var i=0;i<total_no;i++)
      {
       var TempAngle = pie * 2 * (total[1][i] / (totalpie * 2) + TempPie);
       var x1 = table_x + all_width/2 + Math.cos(TempAngle) * all_width * 3/8;
       var y1 = table_y + all_height/2 - Math.sin(TempAngle) * all_height * 3/8;
       var x2 = table_x + all_width/2 + Math.cos(TempAngle) * all_width * 3/4;
       var y2 = table_y + all_height/2 - Math.sin(TempAngle) * all_height * 3/4;
     
       if(x2>table_x + all_width/2)
       {
        x3 = x2 + 20;
        x4 = x3;
       }
       else
       {
        x3 = x2 - 20;
        x4 = x3 - 100;
       }
       document.write("<v:oval id='_x0000_s1027' style='position:absolute;left:" + (x1 - 2) + "px;top:" + (y1 - 2) + "px;width:4px;height:4px; z-index:2' fillcolor='#111111' strokecolor='#111111'/>");
       document.write("<v:line id='_x0000_s1025' alt='' style='position:absolute;left:0;text-align:left;top:0;z-index:1' from='" + x1 + "px," + y1 + "px' to='" + x2 + "px," + y2 + "px' coordsize='21600,21600' strokecolor='#111111' strokeweight='1px'></v:line>");
       document.write("<v:line id='_x0000_s1025' alt='' style='position:absolute;left:0;text-align:left;top:0;z-index:1' from='" + x2 + "px," + y2 + "px' to='" + x3 + "px," + y2 + "px' coordsize='21600,21600' strokecolor='#111111' strokeweight='1px'></v:line>");
       document.write("<v:shape id='_x0000_s1025' type='#_x0000_t202' alt='' style='position:absolute;left:" + x4 + "px;top:" + (y2 - 10) + "px;width:100px;height:20px;z-index:1'>");
       document.write("<v:textbox inset='0px,0px,0px,0px'><table cellspacing='3' cellpadding='0' width='100%' height='100%'><tr><td align='left'>" + total[0][i] + " " + Math.round(parseFloat(total[1][i] * 100/ totalpie)*100)/100 + "%</td></tr></table></v:textbox></v:shape>")
       TempPie += total[1][i]/totalpie;  
      }
     }
    }
      

  6.   

    JpGraph Error: No path specified for TTF_DIR. Please specify a path for that DEFINE in jpgraph.php是什么错误原因啊`~!
      

  7.   

    TTF 文件的路径没有整对~~~~~~~~~~~~~~~~