久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='xjjIT'><style id='xjjIT'><dir id='xjjIT'><q id='xjjIT'></q></dir></style></legend>

      • <bdo id='xjjIT'></bdo><ul id='xjjIT'></ul>
      <i id='xjjIT'><tr id='xjjIT'><dt id='xjjIT'><q id='xjjIT'><span id='xjjIT'><b id='xjjIT'><form id='xjjIT'><ins id='xjjIT'></ins><ul id='xjjIT'></ul><sub id='xjjIT'></sub></form><legend id='xjjIT'></legend><bdo id='xjjIT'><pre id='xjjIT'><center id='xjjIT'></center></pre></bdo></b><th id='xjjIT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xjjIT'><tfoot id='xjjIT'></tfoot><dl id='xjjIT'><fieldset id='xjjIT'></fieldset></dl></div>
      <tfoot id='xjjIT'></tfoot>

      1. <small id='xjjIT'></small><noframes id='xjjIT'>

      2. 將 Google 圖表另存為圖像

        Save Google charts as a image(將 Google 圖表另存為圖像)

        <small id='EP0zl'></small><noframes id='EP0zl'>

      3. <legend id='EP0zl'><style id='EP0zl'><dir id='EP0zl'><q id='EP0zl'></q></dir></style></legend>
          <tbody id='EP0zl'></tbody>

        <i id='EP0zl'><tr id='EP0zl'><dt id='EP0zl'><q id='EP0zl'><span id='EP0zl'><b id='EP0zl'><form id='EP0zl'><ins id='EP0zl'></ins><ul id='EP0zl'></ul><sub id='EP0zl'></sub></form><legend id='EP0zl'></legend><bdo id='EP0zl'><pre id='EP0zl'><center id='EP0zl'></center></pre></bdo></b><th id='EP0zl'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EP0zl'><tfoot id='EP0zl'></tfoot><dl id='EP0zl'><fieldset id='EP0zl'></fieldset></dl></div>
          <bdo id='EP0zl'></bdo><ul id='EP0zl'></ul>
            • <tfoot id='EP0zl'></tfoot>

                  本文介紹了將 Google 圖表另存為圖像的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  因此,經過數小時的網絡搜索、谷歌搜索和大量搜索,我找不到解決問題的方法.

                  So after hours of websearching, googling and overflowing i can't find the solution to my problem.

                  我從 Google 圖表中得到了一個折線圖.我想將其轉換為 PNG,將其保存在服務器上,然后將其插入 MySQL 數據庫中.

                  I got a linechart from Google charts. I want to convert it to PNG, save it on the server en insert it into a MySQL database.

                  聽起來很簡單,但我無法讓它工作.該網站的腳本不再工作(至少不在此處)http://www.Battlehorse.net/page/topics/charts/save_google_charts_as_image.html -> 不工作.

                  Sounds simple, but i cant get it to work. The script from this website isnt working anymore (atleast not here) http://www.battlehorse.net/page/topics/charts/save_google_charts_as_image.html -> Not working.

                  第二個選項是舊選項:

                  $imageData =     file_get_contents('http://chart.apis.google.com/chart... etc');
                  

                  我無法使用它,因為它不再受支持并且無法從中獲得一些不錯的質量.

                  I cant use that because its not supported anymore and cant get some decent quality out of it.

                  這里有人可以提供很好的教程或幫助解決我的問題嗎?

                  Is there anybody here that can give a good tutorial or help for my problem?

                  我使用了 Battlehorse 的代碼和 EriC 的代碼.

                  I used the code from Battlehorse combined with the code from EriC.

                  所以現在我開始工作以將圖表顯示為 DIV 中的圖像,我想將此圖像保存在服務器上并更新 mysql 以在將來使用它以在 PDF 文件中使用它.

                  So now i got this working to show the chart as an image in a DIV i want to save this image on the server and update the mysql to use it in the future to use it in PDF files.

                  推薦答案

                  當您訪問站點時,將其粘貼到控制臺中(覆蓋故障功能).

                  When you visit the site, paste this in the console (overwriting the malfunctioning function).

                    function getImgData(chartContainer) {
                      var chartArea = chartContainer.getElementsByTagName('svg')[0].parentNode;
                      var svg = chartArea.innerHTML;
                      var doc = chartContainer.ownerDocument;
                      var canvas = doc.createElement('canvas');
                      canvas.setAttribute('width', chartArea.offsetWidth);
                      canvas.setAttribute('height', chartArea.offsetHeight);
                  
                  
                      canvas.setAttribute(
                          'style',
                          'position: absolute; ' +
                          'top: ' + (-chartArea.offsetHeight * 2) + 'px;' +
                          'left: ' + (-chartArea.offsetWidth * 2) + 'px;');
                      doc.body.appendChild(canvas);
                      canvg(canvas, svg);
                      var imgData = canvas.toDataURL("image/png");
                      canvas.parentNode.removeChild(canvas);
                      return imgData;
                    }
                  

                  在 JS 中,它正在搜索 iframe bla bla 以獲取 svg.

                  In JS it was searching for an iframe bla bla to get the svg.


                  要自動保存圖像,您可以讓該方法以編程方式調用.


                  To automatically save the image, you can just let the method being invoked programmatically.

                  document.body.addEventListener("load", function() {
                  
                          saveAsImg( document.getElementById("pie_div")); // or your ID
                  
                      }, false );
                  


                  對于在服務器端保存圖像,這篇文章可能會有所幫助 在服務器端保存 PNG 圖像

                  更新
                  將圖片發布到 PHP (index.js)

                  Update
                  Posting images to PHP (index.js)

                  function saveToPHP( imgdata ) {
                  
                      var script = document.createElement("SCRIPT");
                  
                      script.setAttribute( 'type', 'text/javascript' );
                      script.setAttribute( 'src', 'save.php?data=' + imgdata );
                  
                      document.head.appendChild( script );
                  }
                  
                  function save() {
                  
                      var canvas = document.getElementById("canvas"), // Get your canvas
                          imgdata = canvas.toDataURL();
                  
                      saveToPHP( imgdata );
                  }
                  
                  function drawOnCanvas() {
                  
                      var canvas = document.getElementById("canvas"), // Get your canvas
                          ctx = canvas.getContext("2d");
                  
                      ctx.strokeStyle = "#000000";
                      ctx.fillStyle = "#FFFF00";
                      ctx.beginPath();
                      ctx.arc(100,99,50,0,Math.PI*2,true);
                      ctx.closePath();
                      ctx.stroke();
                      ctx.fill();
                  }
                  
                  drawOnCanvas(); // Test
                  save();
                  

                  保存.php

                  <?php
                      // Get the request
                      $data = $_GET['data'];
                  
                      // Save to your DB.
                  ?>
                  

                  這篇關于將 Google 圖表另存為圖像的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                    <tbody id='tR7Ta'></tbody>
                  <i id='tR7Ta'><tr id='tR7Ta'><dt id='tR7Ta'><q id='tR7Ta'><span id='tR7Ta'><b id='tR7Ta'><form id='tR7Ta'><ins id='tR7Ta'></ins><ul id='tR7Ta'></ul><sub id='tR7Ta'></sub></form><legend id='tR7Ta'></legend><bdo id='tR7Ta'><pre id='tR7Ta'><center id='tR7Ta'></center></pre></bdo></b><th id='tR7Ta'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='tR7Ta'><tfoot id='tR7Ta'></tfoot><dl id='tR7Ta'><fieldset id='tR7Ta'></fieldset></dl></div>
                    <bdo id='tR7Ta'></bdo><ul id='tR7Ta'></ul>

                    <small id='tR7Ta'></small><noframes id='tR7Ta'>

                      1. <legend id='tR7Ta'><style id='tR7Ta'><dir id='tR7Ta'><q id='tR7Ta'></q></dir></style></legend>

                          <tfoot id='tR7Ta'></tfoot>

                            主站蜘蛛池模板: av资源中文在线 | 色综合久久久久 | 亚洲a视频 | 中文二区| 亚洲嫩草| 国产91丝袜在线播放 | 久久国产精品精品国产色婷婷 | 亚洲网在线 | 成人伊人| 成人国产a | 国产精品视频综合 | 欧美成年人视频在线观看 | 毛片网在线观看 | 成av在线 | 国产日韩一区二区三免费 | 国产aa | 久久一区二区三区四区 | 可以在线观看av的网站 | 国产黄色免费网站 | 国产欧美日韩综合精品一区二区 | 欧美激情视频一区二区三区免费 | 欧美日韩中文字幕 | 久久999 | 亚洲精品乱码久久久久久黑人 | 国产精品区二区三区日本 | 波多野结衣av中文字幕 | 日本 欧美 国产 | 日韩欧美网 | 国产激情在线 | 欧美日韩一区二区在线 | 三级黄色大片网站 | 国产欧美日韩在线一区 | 亚洲天堂久久新 | 久久香焦 | 69av片| 日日操夜夜操天天操 | 综合久久av | 欧美一区二区三区在线观看视频 | 涩爱av一区二区三区 | 国产精品免费一区二区 | 精品99久久久久久 |