pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="zzz77l7" 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="btbtvx5" 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="bbjrdlp" 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>

                            主站蜘蛛池模板: 河南膏药贴牌-膏药代加工-膏药oem厂家-洛阳今世康医药科技有限公司 | 四川职高信息网-初高中、大专、职业技术学校招生信息网 | 杭州代理记账费用-公司注销需要多久-公司变更监事_杭州福道财务管理咨询有限公司 | 塑料瓶罐_食品塑料瓶_保健品塑料瓶_调味品塑料瓶–东莞市富慷塑料制品有限公司 | 净化车间_洁净厂房_净化公司_净化厂房_无尘室工程_洁净工程装修|改造|施工-深圳净化公司 | 耐火浇注料-喷涂料-浇注料生产厂家_郑州市元领耐火材料有限公司 耐力板-PC阳光板-PC板-PC耐力板 - 嘉兴赢创实业有限公司 | 挖掘机挖斗和铲斗生产厂家选择徐州崛起机械制造有限公司 | 防渗土工膜|污水处理防渗膜|垃圾填埋场防渗膜-泰安佳路通工程材料有限公司 | 北京签证代办_签证办理_商务签证_旅游签证_寰球签证网 | 对夹式止回阀_对夹式蝶形止回阀_对夹式软密封止回阀_超薄型止回阀_不锈钢底阀-温州上炬阀门科技有限公司 | 青岛成人高考_山东成考报名网| 盐城网络公司_盐城网站优化_盐城网站建设_盐城市启晨网络科技有限公司 | 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 飞象网 - 通信人每天必上的网站 全球化工设备网—化工设备,化工机械,制药设备,环保设备的专业网络市场。 | 冷藏车-东风吸污车-纯电动环卫车-污水净化车-应急特勤保障车-程力专汽厂家-程力专用汽车股份有限公司销售二十一分公司 | 干粉砂浆设备_干混砂浆生产线_腻子粉加工设备_石膏抹灰砂浆生产成套设备厂家_干粉混合设备_砂子烘干机--郑州铭将机械设备有限公司 | 机构创新组合设计实验台_液压实验台_气动实训台-戴育教仪厂 | Safety light curtain|Belt Sway Switches|Pull Rope Switch|ultrasonic flaw detector-Shandong Zhuoxin Machinery Co., Ltd | 机房监控|动环监控|动力环境监控系统方案产品定制厂家 - 迈世OMARA | 湖南档案密集架,智能,物证,移动,价格-湖南档案密集架厂家 | 南京欧陆电气股份有限公司-风力发电机官网 | 定量包装机,颗粒定量包装机,粉剂定量包装机,背封颗粒包装机,定量灌装机-上海铸衡电子科技有限公司 | 论文查重_免费论文查重_知网学术不端论文查重检测系统入口_论文查重软件 | 信阳网站建设专家-信阳时代网联-【信阳网站建设百度推广优质服务提供商】信阳网站建设|信阳网络公司|信阳网络营销推广 | 上海平衡机-单面卧式动平衡机-万向节动平衡机-圈带动平衡机厂家-上海申岢动平衡机制造有限公司 | PC构件-PC预制构件-构件设计-建筑预制构件-PC构件厂-锦萧新材料科技(浙江)股份有限公司 | 深圳VI设计-画册设计-LOGO设计-包装设计-品牌策划公司-[智睿画册设计公司] | 培训中心-海南香蕉蛋糕加盟店技术翰香原中心官网总部 | 不锈钢电动球阀_气动高压闸阀_旋塞疏水调节阀_全立阀门-来自温州工业阀门巨头企业 | 青岛空压机,青岛空压机维修/保养,青岛空压机销售/出租公司,青岛空压机厂家电话 | 无刷电机_直流无刷电机_行星减速机-佛山市藤尺机电设备有限公司 无菌检查集菌仪,微生物限度仪器-苏州长留仪器百科 | 焊缝跟踪系统_激光位移传感器_激光焊缝跟踪传感器-创想智控 | 冻干机(冷冻干燥机)_小型|实验型|食品真空冷冻干燥机-松源 | SRRC认证|CCC认证|CTA申请_IMEI|MAC地址注册-英利检测 | 蓝莓施肥机,智能施肥机,自动施肥机,水肥一体化项目,水肥一体机厂家,小型施肥机,圣大节水,滴灌施工方案,山东圣大节水科技有限公司官网17864474793 | 杭州月嫂技术培训服务公司-催乳师培训中心报名费用-产后康复师培训机构-杭州优贝姆健康管理有限公司 | 国际金融网_每日财经新资讯网 | 折弯机-刨槽机-数控折弯机-数控刨槽机-数控折弯机厂家-深圳豐科机械有限公司 | 钢格板_钢格栅_格栅板_钢格栅板 - 安平县鑫拓钢格栅板厂家 | 青岛空压机,青岛空压机维修/保养,青岛空压机销售/出租公司,青岛空压机厂家电话 | 有机废气处理-rto焚烧炉-催化燃烧设备-VOC冷凝回收装置-三梯环境 |