搜尋
首頁後端開發php教程php折線圖、餅狀圖、長條圖的生成實例

  1. var tb_color = new Array(tmdColor1,tmdColor2);

  2. var tb_height = tmdColor1,tmdColor2);
  3. var tb_height = tmdColor1,tmdColor2);
  4. var tb_height = tmdColor1,tmdColor2);
  5. var tb_height = tmdColor1,tmdColor2);
  6. var tb_height = tmdColor1,tmdColor2);
  7. var tb_height = 230;
  8. var total_no = total[0].length;
  9. var totalpie = 0;
  10. for(var i=0;i{total[1][i ]*=100;totalpie += total[1][i];}var PreAngle = 0;for(var i=0;i { document.write("");PreAngle += total[1][i] / totalpie; }
  11. if(table_type=="A")
  12. {
  13. document.write("");
  14. for(var i=0;i{
  15. document.write("");
  16. document.write("" + 總計[0][i] + " ;
    v:shape>");
  17. document.write(" ");
  18. / / 顯示比例數
  19. document.write("");
  20. document. write("" + Math.round(parseFloat(total[1][i ]*100/totalpie)*100)/100 + "%
  21. ");
  22. }
  23. }
  24. if(table_type == "B")
  25. {
  26. var pie = 3.14159265358979;
  27. var Tempfor(var i=0;i{
  28. var TempAngle = 餅* 2 * (total[1][i] / (totalpie * 2) + TempPie);
  29. var x1 = table_x + all_width/2 + Math.cos( TempAngle) * all_width * 3/8;
  30. var y1 = table_y + all_height/2 - Math.sin(TempAngle) * all_height * 3/8;
  31. var x2 = table_x + all_width/2 + Math.cos( TempAngle) * all_width * 3/4;
  32. var y2 = table_y + all_height/2 - Math.sin(TempAngle) * all_height * 3/4;
  33. if(x2>table_x + all_width/2)
  34. {
  35. x3 = x2 + 20;
  36. x4 = x3;
  37. }
  38. else
  39. {
  40. x3 = x2 - 200 ;
  41. x4 = x3 - 100;
  42. }
  43. document.write("");
  44. document.write(" ");
  45. document.write("");
  46. document.write("");
  47. document. write("
" + 總計[0][ i] + " " + Math.round(parseFloat(total[1][i] * 100/totalpie)*100)/100 + "% td>
v:textbox>")
  • TempPie += Total[1][i]/totalpie;
  • }
  • }
  • }
  • //-->
  • function getdata_and_name2(data,name){
  • var dataArray2 = new Array()
  • var dataArray =data.split(",");
  • var nameArray =name.split(",");
  • dataArray2[0]="# 0000FF,1,2,3,"+dataArray[0 ];
  • for(var i=1;i dataArray2[i]=dataArray[i]* 10;
  • }
  • var Total =new Array(nameArray,dataArray2);
  • table2(total,70,980,804,200,1);
  • }
  • function table2(total,table_x,table_y,all_width,all_height,line_no)
  • {
  • //參數意義(傳遞的數組,橫座標,縱座標,圖表的寬度,圖表的高度,折線條數)
  • //******************************************* ********************************************
  • var line_color = "#69f";
  • var left_width = 70;
  • var total_no = total[1].length
  • var temp1,temp2,temp3
  • temp1 = 0;
  • for(var i=1 ;i{
  • for(var j=1;j{
  • if(temp1 temp1 = total[j][i];
  • }
  • }
  • temp1 = parseInt(temp1);
  • if(temp1>9)
  • {
  • temp2 = temp1.toString( ).substr(1,1);
  • if(temp2>4)
  • {
  • temp3 = (parseInt(temp1/(Math.pow(10,(temp1.toString().length-1) )))+1)*Math.pow(10,(temp1.toString().length-1));
  • }
  • else
  • {
  • temp3 = (praseInt(temp1/(Math .pow(10,(temp1.toString().length-1))))+0.5)*Math.pow(10,(temp1.toString().length-1))
  • }
  • }
  • else
  • {
  • if(temp1>4)
  • {
  • emp3 = 10;
  • }
  • else
  • {
  • temp3 = 5;
  • else
  • {
  • temp3 = 5;
  • ^}
  • }
  • temp4 = temp3;
  • document.write("");
  • for(var i=0;i{
  • document.write("");
  • document.write("") ;
  • document.write("");
  • document.write("
    " + temp4 + "
  • ");
  • temp4 = temp4 - temp3/5;
  • }
  • document.write("");
  • document.write("") ;
  • var tmpStr = ""
  • for(i=1;i{var re = /,/g;tmpStr += ",[" " + total[i][0].replace(re,"","") + ""]"}
  • tmpStr = tmpStr.substr(1,tmpStr.length-1)
  • var line_code = eval("new Array(" + tmpStr + ")")
  • for(var j=1;j{
  • for(var i=1;i{
  • var x1 = table_x + left_width + all_width * (i - 1)/(total_no -1)
  • var y1 = table_y + (temp3 - Total[j][i]) * (all_height/temp3)
  • var x2 = table_x + left_width + all_width * i/(total_no-1)
  • var y2 = table_y + (temp3 - Total[j][i+1]) * (all_height/temp3)
  • document.write(" ");
  • switch (parseInt(line_code[j-1][2]))
  • {
  • 情況1:
  • 中斷;
  • 情況2:
  • document.write( " ");
  • break;
  • 情況3:
  • document.write("" );
  • 中斷;
  • 案例4:
  • document.write("");
  • 中斷;
  • 案例5:
  • document.write( "");
  • break;
  • 案例6:
  • document.write("");
  • 中斷;
  • 案例7:
  • document.write("");
  • 中斷;
  • }
  • document.write(" v:line>");
  • switch (parseInt(line_code[j-1][3]))
  • {
  • 情況1:
  • Break;
  • 情況2:
  • document .write("");
  • 中斷;
  • 案例3:
  • document.write("");
  • 中斷;
  • }
  • }
  • switch (parseInt(line_code[j-1][3]))
  • {
  • 情況1:
  • 中斷;
  • 情況2:
  • document.write("");
  • break;
  • 情況3:
  • document.write("");
  • break;
  • }
  • }
  • for(var i=0;i{
  • document.write("");
  • document.write("");
  • document.write("" + Total[0][i] + "");
  • }
  • var tb_height = 30
  • document.write("");
  • for(var i=0;i{
  • document.write("");
  • document.write("
  • " + line_code[i][4] + "
  • ");
  • document.write("均勻>");
  • }
  • }
  • script>
  • function getdata_and_name1(data,name){
  • var dataArray =data. split(",");
  • var nameArray =name.split(",");
  • var Total =new Array(dataArray,nameArray);
  • table1(total,70,350,20,30,800,100," A");
  • }
  • function table1(total,table_x,table_y,thickness,table_width,all_width,all_height,table_type){
  • //參數調節(傳遞的架構,橫向座標,縱向座標,柱子的,柱子的寬度,圖表的寬度,圖表的高度,圖表的形狀類型)
  • //純ASP程式碼產生圖表函數1——柱圖
  • //********** ** ** ********************************************** **** ****** **************************
  • var tmdColor1 = new Array();
  • tmdColor1[0] = "#d1ffd1" ;
  • tmdColor1[1] = "#ffbbbb";
  • tmdColor1[2] = "#ffe3bb";
  • tmdColor1[3] = "#cff4f3";
  • tmdColor1[3] = "#cff4f3";
  • tmdColor1[ 4] = "# d9d9e5";
  • tmdColor1[5] = "#ffc7ab";
  • tmdColor1[6] = "#ecffb7";
  • tmdor1[7] = "#97bbd" ;
  • tmdColor1[8] = "#009900";
  • tmdColor1[9] = "#cc3300";
  • tmdColor1[10] = "#ffcc00";
  • tmdColtmdColor1[10] = "#ffcc00";
  • tmdColtmor1[11] = " 3366cc";
  • tmdColor1[12] = "#33cc33";
  • tmdColor1[13] = "#ff9933";
  • tmdColor1[14] = "#cc99";tmdColor1 [16] = "#66ff99";
  • tmdColor1[17] = "#4f6600";
  • tmdColor1[18] = "#481000";
  • tmdColor1[18] = "#481000"; ] = "# 7d6400";
  • tmdColor1[20] = "#173064";
  • tmdColor1[21] = "#173064";
  • tmdColor1[22] = "#173064";
  • tmdColor1[22] = "#1a6a1a";
  • tmdColor1[22] = "#1a6a1a」; [23] = “#974b00”;
  • tmdColor1[24] = "#78793c";
  • tmdColor1[25] = "#557e27";
  • tmdColor1[26] = "#009337";
  • tmdColor1[26] = "#009337";
  • var tmdor2 = new Ar
  • tmdColor2[0] = "#00ff00";
  • tmdColor2[1] = "#ff0000";
  • tmdColor2[2] = "#ff9900";tmdorColcc2[3] = "#333cc ";
  • tmdColor2[4] = "#666699";
  • tmdColor2[5] = "#993300";
  • tmdColor2[6] = "#99cc00";
  • dtmdColor2[6] = "#99cc00";
  • dtmdor2[7] =f #97bd00";
  • tmdColor2[8] = "#009900";
  • tmdColor2[9] = "#cc3300";
  • tmdColor2[10] = "#ffcc00"; = "#3366cc";
  • tmdColor2[12] = "#33cc33";
  • tmdColor2[13] = "#ff9933";
  • tmdColor2[14] = "#cc99";tmdColor2[16] = "#66ff99";
  • tmdColor2[17] = "#4f6600";
  • tmdColor2[18] = "#4f6600";
  • tmdColor2[18] = "#481000"; tmdColor2[19] = "#7d6400";
  • tmdColor2[20] = "#173064";
  • tmdColor2[21] = "#173064";
  • tmdColor2[21] = "#173064";
  • tmdColor2[22] = "#17366a; 🎜>tmdColor2[23] = "#974b00";
  • tmdColor2[24] = "#78793c";
  • tmdColor2[25] = "#557e27";
  • tmdColor2[25] = "#557e27";
  • tmdColor2[25] = "#557e27";
  • tmdColor2[25] =Col#209333370 ;
  • var tb_color = new Array(tmdColor1,tmdColor2);
  • var line_color = "#69f";
  • var left_width = 70;
  • var length = 厚度/2;
  • var Total_no總共[0].length;
  • var temp1 = 0;
  • var temp2,temp4,temp4;
  • for(var i = 0;i{
  • if( temp1{
  • temp1 = Total[0][i];
  • }
  • }
  • temp1 = parseInt(temp1.toString());
  • if(temp1>9)
  • {
  • temp2 = temp1.toString().substr(1,1)
  • if(temp2>4){temp3 = (parseInt( (temp1/(Math.pow(10,(temp1.toString().length-1))))).toString())+1)*Math.pow(10,(temp1.toString().length-1) );}
  • else
  • {
  • temp3 = (parseInt((temp1/(Math.pow(10,(temp1.toString().length-1)))).toString())+0.5)*Math .pow(10,(temp1.toString().length-1));
  • }
  • }
  • else
  • {
  • if(temp1>4)
  • temp3 = 10;
  • else
  • temp3 = 5;
  • }
  • temp4=temp3
  • document.write("");
  • document.write("");
  • document.write ( "");
  • 開關(table_type)
  • {
  • case "A":
  • var table_space = (all_width-table_width*total_no)/total_no ;
  • document.write("");
  • for(var i=0 ; i{
  • document.write( "");
  • document.write( "");
  • document.write("");
  • document.write( "");
  • document.write("");
  • document.write (" " + temp4 + "
  • " );
  • temp4 = temp4-temp3/5;
  • }
  • for(var i=0;i{
  • var temp_space = table_x + left_width + table_space / 2 + table_space * i + table_width * i;
  • document.write("; " );
  • document.write("")
  • document .write( "" );
  • document.write("
  • ");
  • document.write("");
  • document.write("" + 總計[0][i] + "
  • ");
  • document.write("");
  • document.write("" + 總計[1][ i] + "
  • ");
  • }
  • break;
  • case " B":
  • var table_space = (all_height - table_width * Total_no) / Total_no;
  • document.write( "");
  • for(var i=0;i {
  • document.write("");
  • document.write("");
  • 文件。text-align :left;top:0 ;翻轉:y;z-index:-1' from='" + (table_x+left_width+i+all_width/5) + "px," + (table_y+all_height) + " px' to ='" + (table_x +left_width+i+all_width/5) + "px," + (table_y+all_height+15) + "px'/>");
  • document. write(" ");
  • temp4 = temp4 - temp3 / 5;
  • }
  • for(var i=0;i{
  • var temp_space = table_space/2 + table_space * i + table_width * i;
  • document.write("");
  • document.write("");
  • document.write("");
  • document.write(" v:rect>");
  • document.write("");
  • document.write("" + 總計[0][i] + " tr>
  • " );
  • document.write("");
  • document.write("" + 總計[1][i] + "
  • ");
  • }
  • }
  • }

  • 陳述
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
    PHP的當前狀態:查看網絡開發趨勢PHP的當前狀態:查看網絡開發趨勢Apr 13, 2025 am 12:20 AM

    PHP在現代Web開發中仍然重要,尤其在內容管理和電子商務平台。 1)PHP擁有豐富的生態系統和強大框架支持,如Laravel和Symfony。 2)性能優化可通過OPcache和Nginx實現。 3)PHP8.0引入JIT編譯器,提升性能。 4)雲原生應用通過Docker和Kubernetes部署,提高靈活性和可擴展性。

    PHP與其他語言:比較PHP與其他語言:比較Apr 13, 2025 am 12:19 AM

    PHP適合web開發,特別是在快速開發和處理動態內容方面表現出色,但不擅長數據科學和企業級應用。與Python相比,PHP在web開發中更具優勢,但在數據科學領域不如Python;與Java相比,PHP在企業級應用中表現較差,但在web開發中更靈活;與JavaScript相比,PHP在後端開發中更簡潔,但在前端開發中不如JavaScript。

    PHP與Python:核心功能PHP與Python:核心功能Apr 13, 2025 am 12:16 AM

    PHP和Python各有優勢,適合不同場景。 1.PHP適用於web開發,提供內置web服務器和豐富函數庫。 2.Python適合數據科學和機器學習,語法簡潔且有強大標準庫。選擇時應根據項目需求決定。

    PHP:網絡開發的關鍵語言PHP:網絡開發的關鍵語言Apr 13, 2025 am 12:08 AM

    PHP是一種廣泛應用於服務器端的腳本語言,特別適合web開發。 1.PHP可以嵌入HTML,處理HTTP請求和響應,支持多種數據庫。 2.PHP用於生成動態網頁內容,處理表單數據,訪問數據庫等,具有強大的社區支持和開源資源。 3.PHP是解釋型語言,執行過程包括詞法分析、語法分析、編譯和執行。 4.PHP可以與MySQL結合用於用戶註冊系統等高級應用。 5.調試PHP時,可使用error_reporting()和var_dump()等函數。 6.優化PHP代碼可通過緩存機制、優化數據庫查詢和使用內置函數。 7

    PHP:許多網站的基礎PHP:許多網站的基礎Apr 13, 2025 am 12:07 AM

    PHP成為許多網站首選技術棧的原因包括其易用性、強大社區支持和廣泛應用。 1)易於學習和使用,適合初學者。 2)擁有龐大的開發者社區,資源豐富。 3)廣泛應用於WordPress、Drupal等平台。 4)與Web服務器緊密集成,簡化開發部署。

    超越炒作:評估當今PHP的角色超越炒作:評估當今PHP的角色Apr 12, 2025 am 12:17 AM

    PHP在現代編程中仍然是一個強大且廣泛使用的工具,尤其在web開發領域。 1)PHP易用且與數據庫集成無縫,是許多開發者的首選。 2)它支持動態內容生成和麵向對象編程,適合快速創建和維護網站。 3)PHP的性能可以通過緩存和優化數據庫查詢來提升,其廣泛的社區和豐富生態系統使其在當今技術棧中仍具重要地位。

    PHP中的弱參考是什麼?什麼時候有用?PHP中的弱參考是什麼?什麼時候有用?Apr 12, 2025 am 12:13 AM

    在PHP中,弱引用是通過WeakReference類實現的,不會阻止垃圾回收器回收對象。弱引用適用於緩存系統和事件監聽器等場景,需注意其不能保證對象存活,且垃圾回收可能延遲。

    解釋PHP中的__ Invoke Magic方法。解釋PHP中的__ Invoke Magic方法。Apr 12, 2025 am 12:07 AM

    \_\_invoke方法允許對象像函數一樣被調用。 1.定義\_\_invoke方法使對象可被調用。 2.使用$obj(...)語法時,PHP會執行\_\_invoke方法。 3.適用於日誌記錄和計算器等場景,提高代碼靈活性和可讀性。

    See all articles

    熱AI工具

    Undresser.AI Undress

    Undresser.AI Undress

    人工智慧驅動的應用程序,用於創建逼真的裸體照片

    AI Clothes Remover

    AI Clothes Remover

    用於從照片中去除衣服的線上人工智慧工具。

    Undress AI Tool

    Undress AI Tool

    免費脫衣圖片

    Clothoff.io

    Clothoff.io

    AI脫衣器

    AI Hentai Generator

    AI Hentai Generator

    免費產生 AI 無盡。

    熱門文章

    R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
    3 週前By尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O.最佳圖形設置
    3 週前By尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O.如果您聽不到任何人,如何修復音頻
    3 週前By尊渡假赌尊渡假赌尊渡假赌
    WWE 2K25:如何解鎖Myrise中的所有內容
    4 週前By尊渡假赌尊渡假赌尊渡假赌

    熱工具

    WebStorm Mac版

    WebStorm Mac版

    好用的JavaScript開發工具

    SublimeText3漢化版

    SublimeText3漢化版

    中文版,非常好用

    Dreamweaver Mac版

    Dreamweaver Mac版

    視覺化網頁開發工具

    mPDF

    mPDF

    mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

    Atom編輯器mac版下載

    Atom編輯器mac版下載

    最受歡迎的的開源編輯器