1. <ruby id="fnm5l"></ruby>
  2. \n
    {{name}}<\/div>\n \n \n \n \n \n \n \n<\/body>\n<\/html><\/pre>\n

    現(xiàn)在,將瀏覽器URL指向http:\/\/localhost:8000\/app\/index.html,應該會顯示名稱。 <\/p>\n

    創(chuàng)建圖表<\/strong><\/p>\n

    現(xiàn)在,讓我們繪製一些圖表。首先,在index.html中包含Ajax API。 <\/p>\n

    {{name}}<\/div><\/pre>\n

    接下來,修改index.html中的div,如下所示。 <\/p>\n

    'use strict';\n\n\/* Controllers *\/\n\nangular.module('myApp.controllers', []).\n  controller('MyCtrl1', ['$scope',\n    function($scope) {\n      $scope.name = 'Jay';\n    }\n  ])\n  .controller('MyCtrl2', [\n    function() {\n\n    }\n  ]);<\/pre>\n

    在controllers.js中加載Visualization API和linechart包。 <\/p>\n

    node scripts\/web-server.js<\/pre>\n

    加載包後,我們需要初始化我們的Angular應用程序。 <\/p>\n

    <\/pre>\n

    angular.bootstrap是一個全局API,用於手動啟動Angular應用程序。只需將Google Chart創(chuàng)建代碼複製並粘貼到控制器函數中,這就是我們的最終結果:<\/p>\n

    <\/div><\/pre>\n

    在運行代碼之前,編輯index.html並從html標籤中刪除ng-app=\"myApp\"。 ng-app使用應用程序引導元素。但是,由於我們已經在控制器代碼中執(zhí)行此操作(使用以下代碼行),因此我們可以將其從HTML中刪除。 <\/p>\n

    google.load('visualization', '1', {packages:['corechart']});<\/pre>\n

    重新啟動Node服務器並訪問http:\/\/localhost:8000\/app\/index.html。您應該會看到基於我們的虛擬數據的折線圖。 <\/p>\n

    結論<\/strong><\/p>

    在本教程的這一部分中,我們重點介紹了Angular控制器。在下一篇文章中,我們將重點介紹指令和$scope的使用。同時,本文的所有代碼都可以在GitHub上找到。 <\/p>\n

    使用Google Charts API和AngularJS創(chuàng)建可視化應用程序的常見問題解答(FAQ)<\/strong><\/p>\n

    如何自定義Google Charts的外觀? <\/h3>\n

    Google Charts API提供了廣泛的自定義選項,允許您修改圖表的外觀。您可以更改顏色、字體、網格線等等。要自定義圖表,您需要修改圖表draw()方法中的options對象。例如,要更改圖表的標題,您可以使用以下代碼:<\/p>\n

    \n\n
    <\/div><\/pre>\n

    請記住,options對象可以包含許多屬性,允許您廣泛地自定義圖表。 <\/p>\n

    如何向Google Charts添加交互性? <\/h3>\n

    Google Charts API提供了多種向圖表添加交互性的方法。最常見的方法之一是使用“select”事件,該事件在用戶選擇圖表上的項目時觸發(fā)。您可以向圖表添加一個事件偵聽器,該偵聽器偵聽“select”事件,並在觸發(fā)時執(zhí)行操作。這是一個示例:<\/p>\n

    cd angular-seed\nnode scripts\/web-server.js<\/pre>\n

    在此示例中,當用戶選擇圖表上的項目時,將出現(xiàn)一個警報框,顯示所選項目的value。 <\/p>\n

    如何將Google Charts與AngularJS一起使用? <\/h3>\n

    要將Google Charts與AngularJS一起使用,您可以使用angular-google-charts包。此包提供了一組AngularJS指令,使您可以輕鬆地將Google Charts集成到您的AngularJS應用程序中。要安裝該包,您可以使用以下命令:<\/p>\n

    HTTP Server running at http:\/\/localhost:8000\/<\/code><\/pre>\n

    安裝該包後,您可以使用該包提供的指令來創(chuàng)建和自定義圖表。 <\/p>\n

    如何在Google Charts中連接多個DataTable? <\/h3>\n

    可以使用google.visualization.data.join()方法在Google Charts中連接多個DataTable。此方法將三個DataTable作為參數:第一個DataTable、第二個DataTable以及每個DataTable的鍵列。該方法返回一個新的DataTable,其中包含兩個DataTable中鍵列值匹配的行。這是一個示例:<\/p>\n

    \n\n\n  \n  My AngularJS App<\/title>\n<\/head>\n<body>
    <h1><a href="http://ipnx.cn/">亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱</a></h1>\n  <div ng-controller=\"MyCtrl1\">{{name}}<\/div>\n  <??>\n  <??>\n  <??>\n  <??>\n  <??>\n  <??>\n  <??>\n<\/body>\n<\/html><\/pre>\n<p>在此示例中,dataTable1和dataTable2在每個DataTable的第一列上連接。 <\/p>\n<h3>我可以使用Google Charts創(chuàng)建哪些類型的圖表? <\/h3>\n<p>Google Charts API支持各種圖表類型,包括折線圖、條形圖、餅圖、散點圖、面積圖等等。每種圖表類型在API中都由一個特定的類表示,您可以通過創(chuàng)建相應類的實例來創(chuàng)建圖表。例如,要創(chuàng)建折線圖,您可以使用以下代碼:<\/p>\n<pre class='brush:php;toolbar:false;'><div ng-controller=\"MyCtrl1\">{{name}}<\/div><\/pre>\n<p>在此示例中,將創(chuàng)建一個新的折線圖,並將其顯示在ID為“chart_div”的HTML元素中。 <\/p>"}	</script>
    	
    <meta http-equiv="Cache-Control" content="no-transform" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <script>var V_PATH="/";window.onerror=function(){ return true; };</script>
    </head>
    
    <body data-commit-time="2023-12-28T14:50:12+08:00" class="editor_body body2_2">
    	<link rel="stylesheet" type="text/css" href="/static/csshw/stylehw.css">
    <header>
        <div   id="wjcelcm34c"   class="head">
            <div   id="wjcelcm34c"   class="haed_left">
                <div   id="wjcelcm34c"   class="haed_logo">
                    <a href="http://ipnx.cn/zh-tw/" title="" class="haed_logo_a">
                        <img src="/static/imghw/logo.png" alt="" class="haed_logoimg">
                    </a>
                </div>
                <div   id="wjcelcm34c"   class="head_nav">
                    <div   id="wjcelcm34c"   class="head_navs">
                        <a href="javascript:;" title="社群" class="head_nava head_nava-template1">社群</a>
                        <div   class="wjcelcm34c"   id="dropdown-template1" style="display: none;">
                            <div   id="wjcelcm34c"   class="languagechoose">
                                <a href="http://ipnx.cn/zh-tw/article.html" title="文章" class="languagechoosea on">文章</a>
                                <a href="http://ipnx.cn/zh-tw/faq/zt" title="合集" class="languagechoosea">合集</a>
                                <a href="http://ipnx.cn/zh-tw/wenda.html" title="問答" class="languagechoosea">問答</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="wjcelcm34c"   class="head_navs">
                        <a href="javascript:;" title="學習" class="head_nava head_nava-template1_1">學習</a>
                        <div   class="wjcelcm34c"   id="dropdown-template1_1" style="display: none;">
                            <div   id="wjcelcm34c"   class="languagechoose">
                                <a href="http://ipnx.cn/zh-tw/course.html" title="課程" class="languagechoosea on">課程</a>
                                <a href="http://ipnx.cn/zh-tw/dic/" title="程式設計字典" class="languagechoosea">程式設計字典</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="wjcelcm34c"   class="head_navs">
                        <a href="javascript:;" title="工具庫" class="head_nava head_nava-template1_2">工具庫</a>
                        <div   class="wjcelcm34c"   id="dropdown-template1_2" style="display: none;">
                            <div   id="wjcelcm34c"   class="languagechoose">
                                <a href="http://ipnx.cn/zh-tw/toolset/development-tools" title="開發(fā)工具" class="languagechoosea on">開發(fā)工具</a>
                                <a href="http://ipnx.cn/zh-tw/toolset/website-source-code" title="網站源碼" class="languagechoosea">網站源碼</a>
                                <a href="http://ipnx.cn/zh-tw/toolset/php-libraries" title="PHP 函式庫" class="languagechoosea">PHP 函式庫</a>
                                <a href="http://ipnx.cn/zh-tw/toolset/js-special-effects" title="JS特效" class="languagechoosea on">JS特效</a>
                                <a href="http://ipnx.cn/zh-tw/toolset/website-materials" title="網站素材" class="languagechoosea on">網站素材</a>
                                <a href="http://ipnx.cn/zh-tw/toolset/extension-plug-ins" title="擴充插件" class="languagechoosea on">擴充插件</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="wjcelcm34c"   class="head_navs">
                        <a href="http://ipnx.cn/zh-tw/ai" title="AI工具" class="head_nava head_nava-template1_3">AI工具</a>
                    </div>
    
                    <div   id="wjcelcm34c"   class="head_navs">
                        <a href="javascript:;" title="休閒" class="head_nava head_nava-template1_3">休閒</a>
                        <div   class="wjcelcm34c"   id="dropdown-template1_3" style="display: none;">
                            <div   id="wjcelcm34c"   class="languagechoose">
                                <a href="http://ipnx.cn/zh-tw/game" title="遊戲下載" class="languagechoosea on">遊戲下載</a>
                                <a href="http://ipnx.cn/zh-tw/mobile-game-tutorial/" title="遊戲教程" class="languagechoosea">遊戲教程</a>
    
                            </div>
                        </div>
                    </div>
                </div>
            </div>
                        <div   id="wjcelcm34c"   class="head_search">
                    <input id="key_words"  onkeydown="if (event.keyCode == 13) searchs('zh-tw')" class="search-input" type="text" autocomplete="off" name="keywords" required="required" placeholder="Block,address,transaction,news" value="">
                    <a href="javascript:;" title="搜尋"  onclick="searchs('zh-tw')"><img src="/static/imghw/find.png" alt="搜尋"></a>
                </div>
                    <div   id="wjcelcm34c"   class="head_right">
                <div   id="wjcelcm34c"   class="haed_language">
                    <a href="javascript:;" class="layui-btn haed_language_btn">繁體中文<i class="layui-icon layui-icon-triangle-d"></i></a>
                    <div   class="wjcelcm34c"   id="dropdown-template" style="display: none;">
                        <div   id="wjcelcm34c"   class="languagechoose">
                                                    <a href="javascript:setlang('zh-cn');" title="簡體中文" class="languagechoosea">簡體中文</a>
                                                    <a href="javascript:setlang('en');" title="English" class="languagechoosea">English</a>
                                                    <a href="javascript:;" title="繁體中文" class="languagechoosea">繁體中文</a>
                                                    <a href="javascript:setlang('ja');" title="日本語" class="languagechoosea">日本語</a>
                                                    <a href="javascript:setlang('ko');" title="???" class="languagechoosea">???</a>
                                                    <a href="javascript:setlang('ms');" title="Melayu" class="languagechoosea">Melayu</a>
                                                    <a href="javascript:setlang('fr');" title="Fran?ais" class="languagechoosea">Fran?ais</a>
                                                    <a href="javascript:setlang('de');" title="Deutsch" class="languagechoosea">Deutsch</a>
                                                </div>
                    </div>
                </div>
                <span id="wjcelcm34c"    class="head_right_line"></span>
                                <div style="display: block;" id="login" class="haed_login ">
                        <a href="javascript:;"  title="Login" class="haed_logina ">Login</a>
                    </div>
                    <div style="display: block;" id="reg" class="head_signup login">
                        <a href="javascript:;"  title="singup" class="head_signupa">singup</a>
                    </div>
                
            </div>
        </div>
    </header>
    
    	
    	<main>
    		<div   id="wjcelcm34c"   class="Article_Details_main">
    			<div   id="wjcelcm34c"   class="Article_Details_main1">
    							<div   id="wjcelcm34c"   class="Article_Details_main1L">
    					<div   id="wjcelcm34c"   class="Article_Details_main1Lmain" id="Article_Details_main1Lmain">
    						<div   id="wjcelcm34c"   class="Article_Details_main1L1">目錄</div>
    						<div   id="wjcelcm34c"   class="Article_Details_main1L2" id="Article_Details_main1L2">
    							<!-- 左側懸浮,文章定位標題1 id="Article_Details_main1L2s_1"-->
    															<div   id="wjcelcm34c"   class="Article_Details_main1L2s ">
    									<a href="#如何自定義Google-Charts的外觀" title="如何自定義Google Charts的外觀? " >如何自定義Google Charts的外觀? </a>
    								</div>
    																<div   id="wjcelcm34c"   class="Article_Details_main1L2s ">
    									<a href="#如何向Google-Charts添加交互性" title="如何向Google Charts添加交互性? " >如何向Google Charts添加交互性? </a>
    								</div>
    																<div   id="wjcelcm34c"   class="Article_Details_main1L2s ">
    									<a href="#如何將Google-Charts與AngularJS一起使用" title="如何將Google Charts與AngularJS一起使用? " >如何將Google Charts與AngularJS一起使用? </a>
    								</div>
    																<div   id="wjcelcm34c"   class="Article_Details_main1L2s ">
    									<a href="#如何在Google-Charts中連接多個DataTable" title="如何在Google Charts中連接多個DataTable? " >如何在Google Charts中連接多個DataTable? </a>
    								</div>
    																<div   id="wjcelcm34c"   class="Article_Details_main1L2s ">
    									<a href="#我可以使用Google-Charts創(chuàng)建哪些類型的圖表" title="我可以使用Google Charts創(chuàng)建哪些類型的圖表? " >我可以使用Google Charts創(chuàng)建哪些類型的圖表? </a>
    								</div>
    														</div>
    					</div>
    				</div>
    							<div   id="wjcelcm34c"   class="Article_Details_main1M">
    					<div   id="wjcelcm34c"   class="phpgenera_Details_mainL1">
    						<a href="http://ipnx.cn/zh-tw/" title="首頁"
    							class="phpgenera_Details_mainL1a">首頁</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    												<a href="http://ipnx.cn/zh-tw/web-designer.html"
    							class="phpgenera_Details_mainL1a">web前端</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    												<a href="http://ipnx.cn/zh-tw/js-tutorial.html"
    							class="phpgenera_Details_mainL1a">js教程</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    						<span>使用Google Charts API和AngularJS創(chuàng)建可視化應用程序</span>
    					</div>
    					
    					<div   id="wjcelcm34c"   class="Articlelist_txts">
    						<div   id="wjcelcm34c"   class="Articlelist_txts_info">
    							<h1 class="Articlelist_txts_title">使用Google Charts API和AngularJS創(chuàng)建可視化應用程序</h1>
    							<div   id="wjcelcm34c"   class="Articlelist_txts_info_head">
    								<div   id="wjcelcm34c"   class="author_info">
    									<a href="http://ipnx.cn/zh-tw/member/1468494.html"  class="author_avatar">
    									<img class="lazy"  data-src="https://img.php.cn/upload/avatar/000/000/001/66ea812815a39919.png" src="/static/imghw/default1.png" alt="Jennifer Aniston">
    									</a>
    									<div   id="wjcelcm34c"   class="author_detail">
    																			<a href="http://ipnx.cn/zh-tw/member/1468494.html" class="author_name">Jennifer Aniston</a>
                                    										</div>
    								</div>
                    			</div>
    							<span id="wjcelcm34c"    class="Articlelist_txts_time">Feb 22, 2025 am	 09:44 AM</span>
    														
    						</div>
    					</div>
    					<hr />
    					<div   id="wjcelcm34c"   class="article_main php-article">
    						<div   id="wjcelcm34c"   class="article-list-left detail-content-wrap content">
    						<ins class="adsbygoogle"
    							style="display:block; text-align:center;"
    							data-ad-layout="in-article"
    							data-ad-format="fluid"
    							data-ad-client="ca-pub-5902227090019525"
    							data-ad-slot="3461856641">
    						</ins>
    						
    
    					<p><img src="/static/imghw/default1.png" data-src="https://img.php.cn/upload/article/000/000/000/174018866033061.jpg" class="lazy" alt="Creating a Visualization App Using the Google Charts API and AngularJS "></p>
    <p><strong>核心要點</strong></p>
    <ul>
    <li>Google的熱門JavaScript框架AngularJS可用於構建利用Google Charts API的動態(tài)可視化應用程序。 Angular的雙向綁定功能允許圖表根據數據和用戶輸入動態(tài)變化。 </li>
    <li>使用AngularJS創(chuàng)建可視化應用程序涉及多個步驟,例如設置Angular、構建應用程序和創(chuàng)建圖表。此過程需要使用HTML和JavaScript編寫代碼,使用Angular的MVC設計模式,並集成Google Charts API進行可視化。 </li>
    <li>Google Charts API提供了各種圖表自定義選項,包括更改顏色、字體和網格線。它還提供交互功能,例如在用戶選擇圖表上的項目時觸發(fā)事件。要將Google Charts與AngularJS一起使用,開發(fā)人員可以使用angular-google-charts包。 </li>
    </ul>
    <p>如今,JavaScript無處不在。許多有用的JavaScript框架,如Ember.js、Backbone.js等,正在改變Web的面貌。最流行的框架之一是Google開發(fā)的AngularJS。本文是三篇系列文章中的第一篇,將教你如何使用AngularJS構建可視化應用程序。示例應用程序將使用Google Charts API可視化數據。我們將使用Angular令人讚嘆的雙向綁定功能之一,使我們的圖表根據數據和用戶輸入動態(tài)變化。在開始之前,讓我們首先了解如何使用Google Charts API。對於此應用程序,我們將堅持使用一些基本圖表,例如折線圖、餅圖等。 </p>
    <p><strong>Google Charts</strong></p>
    <p>直接從Google Charts文檔中,以下示例快速回顧瞭如何使用Google Charts API。第一個腳本加載AJAX API。在第二個腳本中,第一行加載Visualization API和linechart包。第二行設置一個回調函數,在Google Visualization API加載時運行。回調函數創(chuàng)建一個數據表,設置一些圖表選項,實例化我們的圖表並創(chuàng)建圖表。 </p>
    <pre class='brush:php;toolbar:false;'><??>
    <??>
    <div id="chart_div" style="width: 900px; height: 500px;"></div></pre>
    <p>如果您不熟悉此API,或者需要復習,我建議您閱讀Google Charts文檔。 </p>
    <p><strong>AngularJS</strong></p>
    <p>在開始使用Angular之前,您應該:</p>
    <ul>
    <li>安裝Node.js</li>
    <li>從GitHub克隆種子項目</li>
    </ul>
    <p>從終端導航到種子項目,然後輸入以下命令:</p>
    <pre class='brush:php;toolbar:false;'>cd angular-seed
    node scripts/web-server.js</pre>
    <p>您應該看到以下消息輸出到控制臺:</p>
    <pre class="brush:php;toolbar:false"><code>HTTP Server running at http://localhost:8000/</code></pre>
    <p>此時,您可以通過導航到http://localhost:8000/app/index.html查看演示頁面。 </p><p>Angular使用MVC(模型-視圖-控制器)設計模式。在本教程中,我們將重點關注控制器。目前,可以將控制器視為處理頁面特定部分並使用視圖呈現(xiàn)數據的邏輯。一旦我們開始編寫應用程序,我們將更好地了解控制器是什麼?,F(xiàn)在,讓我們看看Angular種子項目。它是一個Angular應用程序模板,我們將在此基礎上構建我們的應用程序。在Angular種子項目中,導航到app/js。在那裡,我們可以看到控制器、指令、應用程序、過濾器和服務。這些是我們創(chuàng)建應用程序時將要使用的內容。 </p>
    <p><strong>構建應用程序</strong></p>
    <p>將index.html中的代碼替換為以下代碼:</p>
    <pre class='brush:php;toolbar:false;'><??>
    <??>
    <div id="chart_div" style="width: 900px; height: 500px;"></div></pre>
    <p><strong>控制器</strong></p>
    <p>如前所述,控制器包含處理頁面特定部分的邏輯。在之前的代碼示例中,請注意以下行:</p>
    <pre class='brush:php;toolbar:false;'>cd angular-seed
    node scripts/web-server.js</pre>
    <p>此div具有一個ng-controller屬性,其值為MyCtrl1。 MyCtrl1是在文件app/js/controllers.js中找到的控制器函數的名稱。 ng-controller屬性稱為<em>指令</em>。 Angular指令用於增強HTML,ng-controller指令用於設置頁面的特定部分的控制器。 {{name}}是用於將數據從控制器傳遞到視圖的變量。現(xiàn)在,問題是如何在MyCtrl1控制器內訪問變量name。這就是$scope發(fā)揮作用的地方。 $scope是一個對象,充當控制器和視圖之間的通信機制。檢查下面修改後的controllers.js代碼:</p>
    <pre class="brush:php;toolbar:false"><code>HTTP Server running at http://localhost:8000/</code></pre>
    <p>在之前的代碼中,我們正在傳遞$scope作為參數並設置變量name。現(xiàn)在,只需使用以下命令重新啟動Node.js服務器。 </p>
    <pre class='brush:php;toolbar:false;'><!DOCTYPE html>
    <html lang="en" ng-app="myApp">
    <head>
      <meta charset="utf-8">
      <title>My AngularJS App</title>
    </head>
    <body>
      <div ng-controller="MyCtrl1">{{name}}</div>
      <??>
      <??>
      <??>
      <??>
      <??>
      <??>
      <??>
    </body>
    </html></pre>
    <p>現(xiàn)在,將瀏覽器URL指向http://localhost:8000/app/index.html,應該會顯示名稱。 </p>
    <p><strong>創(chuàng)建圖表</strong></p>
    <p>現(xiàn)在,讓我們繪製一些圖表。首先,在index.html中包含Ajax API。 </p>
    <pre class='brush:php;toolbar:false;'><div ng-controller="MyCtrl1">{{name}}</div></pre>
    <p>接下來,修改index.html中的div,如下所示。 </p>
    <pre class='brush:php;toolbar:false;'>'use strict';
    
    /* Controllers */
    
    angular.module('myApp.controllers', []).
      controller('MyCtrl1', ['$scope',
        function($scope) {
          $scope.name = 'Jay';
        }
      ])
      .controller('MyCtrl2', [
        function() {
    
        }
      ]);</pre>
    <p>在controllers.js中加載Visualization API和linechart包。 </p>
    <pre class='brush:php;toolbar:false;'>node scripts/web-server.js</pre>
    <p>加載包後,我們需要初始化我們的Angular應用程序。 </p>
    <pre class='brush:php;toolbar:false;'><??></pre>
    <p>angular.bootstrap是一個全局API,用於手動啟動Angular應用程序。只需將Google Chart創(chuàng)建代碼複製並粘貼到控制器函數中,這就是我們的最終結果:</p>
    <pre class='brush:php;toolbar:false;'><div ng-controller="MyCtrl1" id="chartdiv"></div></pre>
    <p>在運行代碼之前,編輯index.html並從html標籤中刪除ng-app="myApp"。 ng-app使用應用程序引導元素。但是,由於我們已經在控制器代碼中執(zhí)行此操作(使用以下代碼行),因此我們可以將其從HTML中刪除。 </p>
    <pre class='brush:php;toolbar:false;'>google.load('visualization', '1', {packages:['corechart']});</pre>
    <p>重新啟動Node服務器並訪問http://localhost:8000/app/index.html。您應該會看到基於我們的虛擬數據的折線圖。 </p>
    <p><strong>結論</strong></p><p>在本教程的這一部分中,我們重點介紹了Angular控制器。在下一篇文章中,我們將重點介紹指令和$scope的使用。同時,本文的所有代碼都可以在GitHub上找到。 </p>
    <p><strong>使用Google Charts API和AngularJS創(chuàng)建可視化應用程序的常見問題解答(FAQ)</strong></p>
    <h3 id="如何自定義Google-Charts的外觀">如何自定義Google Charts的外觀? </h3>
    <p>Google Charts API提供了廣泛的自定義選項,允許您修改圖表的外觀。您可以更改顏色、字體、網格線等等。要自定義圖表,您需要修改圖表draw()方法中的options對象。例如,要更改圖表的標題,您可以使用以下代碼:</p>
    <pre class='brush:php;toolbar:false;'><??>
    <??>
    <div id="chart_div" style="width: 900px; height: 500px;"></div></pre>
    <p>請記住,options對象可以包含許多屬性,允許您廣泛地自定義圖表。 </p>
    <h3 id="如何向Google-Charts添加交互性">如何向Google Charts添加交互性? </h3>
    <p>Google Charts API提供了多種向圖表添加交互性的方法。最常見的方法之一是使用“select”事件,該事件在用戶選擇圖表上的項目時觸發(fā)。您可以向圖表添加一個事件偵聽器,該偵聽器偵聽“select”事件,並在觸發(fā)時執(zhí)行操作。這是一個示例:</p>
    <pre class='brush:php;toolbar:false;'>cd angular-seed
    node scripts/web-server.js</pre>
    <p>在此示例中,當用戶選擇圖表上的項目時,將出現(xiàn)一個警報框,顯示所選項目的value。 </p>
    <h3 id="如何將Google-Charts與AngularJS一起使用">如何將Google Charts與AngularJS一起使用? </h3>
    <p>要將Google Charts與AngularJS一起使用,您可以使用angular-google-charts包。此包提供了一組AngularJS指令,使您可以輕鬆地將Google Charts集成到您的AngularJS應用程序中。要安裝該包,您可以使用以下命令:</p>
    <pre class="brush:php;toolbar:false"><code>HTTP Server running at http://localhost:8000/</code></pre>
    <p>安裝該包後,您可以使用該包提供的指令來創(chuàng)建和自定義圖表。 </p>
    <h3 id="如何在Google-Charts中連接多個DataTable">如何在Google Charts中連接多個DataTable? </h3>
    <p>可以使用google.visualization.data.join()方法在Google Charts中連接多個DataTable。此方法將三個DataTable作為參數:第一個DataTable、第二個DataTable以及每個DataTable的鍵列。該方法返回一個新的DataTable,其中包含兩個DataTable中鍵列值匹配的行。這是一個示例:</p>
    <pre class='brush:php;toolbar:false;'><!DOCTYPE html>
    <html lang="en" ng-app="myApp">
    <head>
      <meta charset="utf-8">
      <title>My AngularJS App</title>
    </head>
    <body>
      <div ng-controller="MyCtrl1">{{name}}</div>
      <??>
      <??>
      <??>
      <??>
      <??>
      <??>
      <??>
    </body>
    </html></pre>
    <p>在此示例中,dataTable1和dataTable2在每個DataTable的第一列上連接。 </p>
    <h3 id="我可以使用Google-Charts創(chuàng)建哪些類型的圖表">我可以使用Google Charts創(chuàng)建哪些類型的圖表? </h3>
    <p>Google Charts API支持各種圖表類型,包括折線圖、條形圖、餅圖、散點圖、面積圖等等。每種圖表類型在API中都由一個特定的類表示,您可以通過創(chuàng)建相應類的實例來創(chuàng)建圖表。例如,要創(chuàng)建折線圖,您可以使用以下代碼:</p>
    <pre class='brush:php;toolbar:false;'><div ng-controller="MyCtrl1">{{name}}</div></pre>
    <p>在此示例中,將創(chuàng)建一個新的折線圖,並將其顯示在ID為“chart_div”的HTML元素中。 </p><p>以上是使用Google Charts API和AngularJS創(chuàng)建可視化應用程序的詳細內容。更多資訊請關注PHP中文網其他相關文章!</p>
    
    
    						</div>
    					</div>
    					<div   id="wjcelcm34c"   class="wzconShengming_sp">
    						<div   id="wjcelcm34c"   class="bzsmdiv_sp">本網站聲明</div>
    						<div>本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發(fā)現(xiàn)涉嫌抄襲或侵權的內容,請聯(lián)絡admin@php.cn</div>
    					</div>
    				</div>
    
    				<ins class="adsbygoogle"
         style="display:block"
         data-ad-format="autorelaxed"
         data-ad-client="ca-pub-5902227090019525"
         data-ad-slot="2507867629"></ins>
    
    
    
    				<div   id="wjcelcm34c"   class="AI_ToolDetails_main4sR">
    
    
    				<ins class="adsbygoogle"
            style="display:block"
            data-ad-client="ca-pub-5902227090019525"
            data-ad-slot="3653428331"
            data-ad-format="auto"
            data-full-width-responsive="true"></ins>
        
    
    
    					<!-- <div   id="wjcelcm34c"   class="phpgenera_Details_mainR4">
    						<div   id="wjcelcm34c"   class="phpmain1_4R_readrank">
    							<div   id="wjcelcm34c"   class="phpmain1_4R_readrank_top">
    								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									src="/static/imghw/hotarticle2.png" alt="" />
    								<h2>熱門文章</h2>
    							</div>
    							<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottom">
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796832397.html" title="Grass Wonder Build Guide |烏瑪媽媽漂亮的德比" class="phpgenera_Details_mainR4_bottom_title">Grass Wonder Build Guide |烏瑪媽媽漂亮的德比</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 週前</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796833110.html" title="<??>:在森林裡99夜 - 所有徽章以及如何解鎖" class="phpgenera_Details_mainR4_bottom_title"><??>:在森林裡99夜 - 所有徽章以及如何解鎖</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>3 週前</span>
    										<span>By DDD</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796831605.html" title="烏瑪的粉絲漂亮的德比橫幅日程(2025年7月)" class="phpgenera_Details_mainR4_bottom_title">烏瑪的粉絲漂亮的德比橫幅日程(2025年7月)</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 週前</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796831905.html" title="Windows安全是空白或不顯示選項" class="phpgenera_Details_mainR4_bottom_title">Windows安全是空白或不顯示選項</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 週前</span>
    										<span>By 下次還敢</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796836699.html" title="Rimworld Odyssey溫度指南和Gravtech" class="phpgenera_Details_mainR4_bottom_title">Rimworld Odyssey溫度指南和Gravtech</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>3 週前</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    														</div>
    							<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3_more">
    								<a href="http://ipnx.cn/zh-tw/article.html">顯示更多</a>
    							</div>
    						</div>
    					</div> -->
    
    
    											<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3">
    							<div   id="wjcelcm34c"   class="phpmain1_4R_readrank">
    								<div   id="wjcelcm34c"   class="phpmain1_4R_readrank_top">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/hottools2.png" alt="" />
    									<h2>熱AI工具</h2>
    								</div>
    								<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3_bottom">
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title">
    													<h3>Undress AI Tool</h3>
    												</a>
    												<p>免費脫衣圖片</p>
    											</div>
    										</div>
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title">
    													<h3>Undresser.AI Undress</h3>
    												</a>
    												<p>人工智慧驅動的應用程序,用於創(chuàng)建逼真的裸體照片</p>
    											</div>
    										</div>
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title">
    													<h3>AI Clothes Remover</h3>
    												</a>
    												<p>用於從照片中去除衣服的線上人工智慧工具。</p>
    											</div>
    										</div>
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title">
    													<h3>Clothoff.io</h3>
    												</a>
    												<p>AI脫衣器</p>
    											</div>
    										</div>
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/ai_manual/001/246/273/173414504068133.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Video Face Swap" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/ai/video-swap" title="Video Face Swap" class="phpmain_tab2_mids_title">
    													<h3>Video Face Swap</h3>
    												</a>
    												<p>使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!</p>
    											</div>
    										</div>
    																</div>
    								<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3_more">
    									<a href="http://ipnx.cn/zh-tw/ai">顯示更多</a>
    								</div>
    							</div>
    						</div>
    					
    
    
    					<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4">
    						<div   id="wjcelcm34c"   class="phpmain1_4R_readrank">
    							<div   id="wjcelcm34c"   class="phpmain1_4R_readrank_top">
    								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									src="/static/imghw/hotarticle2.png" alt="" />
    								<h2>熱門文章</h2>
    							</div>
    							<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottom">
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796832397.html" title="Grass Wonder Build Guide |烏瑪媽媽漂亮的德比" class="phpgenera_Details_mainR4_bottom_title">Grass Wonder Build Guide |烏瑪媽媽漂亮的德比</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 週前</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796833110.html" title="<??>:在森林裡99夜 - 所有徽章以及如何解鎖" class="phpgenera_Details_mainR4_bottom_title"><??>:在森林裡99夜 - 所有徽章以及如何解鎖</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>3 週前</span>
    										<span>By DDD</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796831605.html" title="烏瑪的粉絲漂亮的德比橫幅日程(2025年7月)" class="phpgenera_Details_mainR4_bottom_title">烏瑪的粉絲漂亮的德比橫幅日程(2025年7月)</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 週前</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796831905.html" title="Windows安全是空白或不顯示選項" class="phpgenera_Details_mainR4_bottom_title">Windows安全是空白或不顯示選項</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>4 週前</span>
    										<span>By 下次還敢</span>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/1796836699.html" title="Rimworld Odyssey溫度指南和Gravtech" class="phpgenera_Details_mainR4_bottom_title">Rimworld Odyssey溫度指南和Gravtech</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<span>3 週前</span>
    										<span>By Jack chen</span>
    									</div>
    								</div>
    														</div>
    							<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3_more">
    								<a href="http://ipnx.cn/zh-tw/article.html">顯示更多</a>
    							</div>
    						</div>
    					</div>
    
    
    											<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3">
    							<div   id="wjcelcm34c"   class="phpmain1_4R_readrank">
    								<div   id="wjcelcm34c"   class="phpmain1_4R_readrank_top">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/hottools2.png" alt="" />
    									<h2>熱工具</h2>
    								</div>
    								<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3_bottom">
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/toolset/development-tools/92" title="記事本++7.3.1" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="記事本++7.3.1" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/toolset/development-tools/92" title="記事本++7.3.1" class="phpmain_tab2_mids_title">
    													<h3>記事本++7.3.1</h3>
    												</a>
    												<p>好用且免費的程式碼編輯器</p>
    											</div>
    										</div>
    																			<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/toolset/development-tools/93" title="SublimeText3漢化版" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3漢化版" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/toolset/development-tools/93" title="SublimeText3漢化版" class="phpmain_tab2_mids_title">
    													<h3>SublimeText3漢化版</h3>
    												</a>
    												<p>中文版,非常好用</p>
    											</div>
    										</div>
    																			<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/toolset/development-tools/121" title="禪工作室 13.0.1" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="禪工作室 13.0.1" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/toolset/development-tools/121" title="禪工作室 13.0.1" class="phpmain_tab2_mids_title">
    													<h3>禪工作室 13.0.1</h3>
    												</a>
    												<p>強大的PHP整合開發(fā)環(huán)境</p>
    											</div>
    										</div>
    																			<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="Dreamweaver CS6" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title">
    													<h3>Dreamweaver CS6</h3>
    												</a>
    												<p>視覺化網頁開發(fā)工具</p>
    											</div>
    										</div>
    																			<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh-tw/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_top_img">
    												<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    													class="lazy"  data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac版" />
    											</a>
    											<div   id="wjcelcm34c"   class="phpmain_tab2_mids_info">
    												<a href="http://ipnx.cn/zh-tw/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_title">
    													<h3>SublimeText3 Mac版</h3>
    												</a>
    												<p>神級程式碼編輯軟體(SublimeText3)</p>
    											</div>
    										</div>
    																	</div>
    								<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3_more">
    									<a href="http://ipnx.cn/zh-tw/ai">顯示更多</a>
    								</div>
    							</div>
    						</div>
    										
    
    					
    					<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4">
    						<div   id="wjcelcm34c"   class="phpmain1_4R_readrank">
    							<div   id="wjcelcm34c"   class="phpmain1_4R_readrank_top">
    								<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    									src="/static/imghw/hotarticle2.png" alt="" />
    								<h2>熱門話題</h2>
    							</div>
    							<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottom">
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/laravel-tutori" title="Laravel 教程" class="phpgenera_Details_mainR4_bottom_title">Laravel 教程</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/eyess.png" alt="" />
    											<span>1597</span>
    										</div>
    										<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/tiezi.png" alt="" />
    											<span>29</span>
    										</div>
    									</div>
    								</div>
    															<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms">
    									<a href="http://ipnx.cn/zh-tw/faq/php-tutorial" title="PHP教程" class="phpgenera_Details_mainR4_bottom_title">PHP教程</a>
    									<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_info">
    										<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/eyess.png" alt="" />
    											<span>1488</span>
    										</div>
    										<div   id="wjcelcm34c"   class="phpgenera_Details_mainR4_bottoms_infos">
    											<img src="/static/imghw/tiezi.png" alt="" />
    											<span>72</span>
    										</div>
    									</div>
    								</div>
    														</div>
    							<div   id="wjcelcm34c"   class="phpgenera_Details_mainR3_more">
    								<a href="http://ipnx.cn/zh-tw/faq/zt">顯示更多</a>
    							</div>
    						</div>
    					</div>
    				</div>
    			</div>
    							<div   id="wjcelcm34c"   class="Article_Details_main2">
    					<div   id="wjcelcm34c"   class="phpgenera_Details_mainL4">
    						<div   id="wjcelcm34c"   class="phpmain1_2_top">
    							<a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img
    									src="/static/imghw/index2_title2.png" alt="" /></a>
    						</div>
    						<div   id="wjcelcm34c"   class="phpgenera_Details_mainL4_info">
    
    													<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796836217.html" title="如何在node.js中提出HTTP請求?" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/431/639/175234432058757.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="如何在node.js中提出HTTP請求?" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796836217.html" title="如何在node.js中提出HTTP請求?" class="phphistorical_Version2_mids_title">如何在node.js中提出HTTP請求?</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 13, 2025 am	 02:18 AM</span>
    								<p class="Articlelist_txts_p">在Node.js中發(fā)起HTTP請求有三種常用方式:使用內置模塊、axios和node-fetch。 1.使用內置的http/https模塊無需依賴,適合基礎場景,但需手動處理數據拼接和錯誤監(jiān)聽,例如用https.get()獲取數據或通過.write()發(fā)送POST請求;2.axios是基於Promise的第三方庫,語法簡潔且功能強大,支持async/await、自動JSON轉換、攔截器等,推薦用於簡化異步請求操作;3.node-fetch提供類似瀏覽器fetch的風格,基於Promise且語法簡單</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796836292.html" title="JavaScript數據類型:原始與參考" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/431/639/175234579081669.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JavaScript數據類型:原始與參考" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796836292.html" title="JavaScript數據類型:原始與參考" class="phphistorical_Version2_mids_title">JavaScript數據類型:原始與參考</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 13, 2025 am	 02:43 AM</span>
    								<p class="Articlelist_txts_p">JavaScript的數據類型分為原始類型和引用類型。原始類型包括string、number、boolean、null、undefined和symbol,其值不可變且賦值時復制副本,因此互不影響;引用類型如對象、數組和函數存儲的是內存地址,指向同一對象的變量會相互影響。判斷類型可用typeof和instanceof,但需注意typeofnull的歷史問題。理解這兩類差異有助於編寫更穩(wěn)定可靠的代碼。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796830657.html" title="React與Angular vs Vue:哪個JS框架最好?" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/431/639/175165349052637.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="React與Angular vs Vue:哪個JS框架最好?" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796830657.html" title="React與Angular vs Vue:哪個JS框架最好?" class="phphistorical_Version2_mids_title">React與Angular vs Vue:哪個JS框架最好?</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 05, 2025 am	 02:24 AM</span>
    								<p class="Articlelist_txts_p">選哪個JavaScript框架最好?答案是根據需求選擇最適合的。 1.React靈活自由,適合需要高度定制、團隊有架構能力的中大型項目;2.Angular提供完整解決方案,適合企業(yè)級應用和長期維護的大項目;3.Vue上手簡單,適合中小型項目或快速開發(fā)。此外,是否已有技術棧、團隊規(guī)模、項目生命週期及是否需要SSR也都是選擇框架的重要因素。總之,沒有絕對最好的框架,適合自己需求的就是最佳選擇。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796832745.html" title="JavaScript時間對象,某人構建了一個eactexe,在Google Chrome上更快的網站等等" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/246/273/173914572643912.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JavaScript時間對象,某人構建了一個eactexe,在Google Chrome上更快的網站等等" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796832745.html" title="JavaScript時間對象,某人構建了一個eactexe,在Google Chrome上更快的網站等等" class="phphistorical_Version2_mids_title">JavaScript時間對象,某人構建了一個eactexe,在Google Chrome上更快的網站等等</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 08, 2025 pm	 02:27 PM</span>
    								<p class="Articlelist_txts_p">JavaScript開發(fā)者們,大家好!歡迎閱讀本週的JavaScript新聞!本週我們將重點關注:Oracle與Deno的商標糾紛、新的JavaScript時間對象獲得瀏覽器支持、GoogleChrome的更新以及一些強大的開發(fā)者工具。讓我們開始吧! Oracle與Deno的商標之爭Oracle試圖註冊“JavaScript”商標的舉動引發(fā)爭議。 Node.js和Deno的創(chuàng)建者RyanDahl已提交請願書,要求取消該商標,他認為JavaScript是一個開放標準,不應由Oracle</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796832608.html" title="處理諾言:鏈接,錯誤處理和承諾在JavaScript中" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/253/068/175191360175213.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="處理諾言:鏈接,錯誤處理和承諾在JavaScript中" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796832608.html" title="處理諾言:鏈接,錯誤處理和承諾在JavaScript中" class="phphistorical_Version2_mids_title">處理諾言:鏈接,錯誤處理和承諾在JavaScript中</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 08, 2025 am	 02:40 AM</span>
    								<p class="Articlelist_txts_p">Promise是JavaScript中處理異步操作的核心機制,理解鍊式調用、錯誤處理和組合器是掌握其應用的關鍵。 1.鍊式調用通過.then()返回新Promise實現(xiàn)異步流程串聯(lián),每個.then()接收上一步結果並可返回值或Promise;2.錯誤處理應統(tǒng)一使用.catch()捕獲異常,避免靜默失敗,並可在catch中返回默認值繼續(xù)流程;3.組合器如Promise.all()(全成功才成功)、Promise.race()(首個完成即返回)和Promise.allSettled()(等待所有完成)</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796832618.html" title="什麼是緩存API?如何與服務人員使用?" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/253/068/175191380054750.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="什麼是緩存API?如何與服務人員使用?" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796832618.html" title="什麼是緩存API?如何與服務人員使用?" class="phphistorical_Version2_mids_title">什麼是緩存API?如何與服務人員使用?</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 08, 2025 am	 02:43 AM</span>
    								<p class="Articlelist_txts_p">CacheAPI是瀏覽器提供的一種緩存網絡請求的工具,常與ServiceWorker配合使用,以提升網站性能和離線體驗。 1.它允許開發(fā)者手動存儲如腳本、樣式表、圖片等資源;2.可根據請求匹配緩存響應;3.支持刪除特定緩存或清空整個緩存;4.通過ServiceWorker監(jiān)聽fetch事件實現(xiàn)緩存優(yōu)先或網絡優(yōu)先等策略;5.常用於離線支持、加快重複訪問速度、預加載關鍵資源及後臺更新內容;6.使用時需注意緩存版本控制、存儲限制及與HTTP緩存機制的區(qū)別。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796831296.html" title="利用Array.Prototype方法用於JavaScript中的數據操作" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/253/068/175174058098308.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="利用Array.Prototype方法用於JavaScript中的數據操作" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796831296.html" title="利用Array.Prototype方法用於JavaScript中的數據操作" class="phphistorical_Version2_mids_title">利用Array.Prototype方法用於JavaScript中的數據操作</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 06, 2025 am	 02:36 AM</span>
    								<p class="Articlelist_txts_p">JavaScript數組內置方法如.map()、.filter()和.reduce()可簡化數據處理;1).map()用於一對一轉換元素生成新數組;2).filter()按條件篩選元素;3).reduce()用於聚合數據為單一值;使用時應避免誤用導致副作用或性能問題。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh-tw/faq/1796832563.html" title="JS綜述:深入研究JavaScript事件循環(huán)" class="phphistorical_Version2_mids_img">
    									<img onerror="this.onerror=''; this.src='/static/imghw/default1.png'"
    										src="/static/imghw/default1.png" class="lazy"  data-src="https://img.php.cn/upload/article/001/431/639/175191266081499.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="JS綜述:深入研究JavaScript事件循環(huán)" />
    								</a>
    								<a href="http://ipnx.cn/zh-tw/faq/1796832563.html" title="JS綜述:深入研究JavaScript事件循環(huán)" class="phphistorical_Version2_mids_title">JS綜述:深入研究JavaScript事件循環(huán)</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 08, 2025 am	 02:24 AM</span>
    								<p class="Articlelist_txts_p">JavaScript的事件循環(huán)通過協(xié)調調用棧、WebAPI和任務隊列來管理異步操作。 1.調用棧執(zhí)行同步代碼,遇到異步任務時交由WebAPI處理;2.WebAPI在後臺完成任務後將回調放入相應的隊列(宏任務或微任務);3.事件循環(huán)檢查調用棧是否為空,若為空則從隊列中取出回調推入調用棧執(zhí)行;4.微任務(如Promise.then)優(yōu)先於宏任務(如setTimeout)執(zhí)行;5.理解事件循環(huán)有助於避免阻塞主線程並優(yōu)化代碼執(zhí)行順序。</p>
    							</div>
    													</div>
    
    													<a href="http://ipnx.cn/zh-tw/web-designer.html" class="phpgenera_Details_mainL4_botton">
    								<span>See all articles</span>
    								<img src="/static/imghw/down_right.png" alt="" />
    							</a>
    											</div>
    				</div>
    					</div>
    	</main>
    	<footer>
        <div   id="wjcelcm34c"   class="footer">
            <div   id="wjcelcm34c"   class="footertop">
                <img src="/static/imghw/logo.png" alt="">
                <p>公益線上PHP培訓,幫助PHP學習者快速成長!</p>
            </div>
            <div   id="wjcelcm34c"   class="footermid">
                <a href="http://ipnx.cn/zh-tw/about/us.html">關於我們</a>
                <a href="http://ipnx.cn/zh-tw/about/disclaimer.html">免責聲明</a>
                <a href="http://ipnx.cn/zh-tw/update/article_0_1.html">Sitemap</a>
            </div>
            <div   id="wjcelcm34c"   class="footerbottom">
                <p>
                    ? php.cn All rights reserved
                </p>
            </div>
        </div>
    </footer>
    
    <input type="hidden" id="verifycode" value="/captcha.html">
    
    
    
    
    		<link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' />
    	
    	
    	
    	
    	
    
    	
    	
    
    
    
    
    
    
    <footer>
    <div class="friendship-link">
    <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p>
    <a href="http://ipnx.cn/" title="亚洲国产日韩欧美一区二区三区">亚洲国产日韩欧美一区二区三区</a>
    
    <div class="friend-links">
    
    
    </div>
    </div>
    
    </footer>
    
    
    <script>
    (function(){
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
    </script>
    </body><div id="fhaw1" class="pl_css_ganrao" style="display: none;"><strike id="fhaw1"><big id="fhaw1"></big></strike><delect id="fhaw1"><tr id="fhaw1"><u id="fhaw1"><form id="fhaw1"></form></u></tr></delect><meter id="fhaw1"><sup id="fhaw1"></sup></meter><center id="fhaw1"><pre id="fhaw1"><abbr id="fhaw1"></abbr></pre></center><meter id="fhaw1"></meter><source id="fhaw1"></source><output id="fhaw1"></output><dl id="fhaw1"></dl><i id="fhaw1"><p id="fhaw1"><span id="fhaw1"><ins id="fhaw1"></ins></span></p></i><center id="fhaw1"></center><ins id="fhaw1"></ins><big id="fhaw1"><samp id="fhaw1"><del id="fhaw1"></del></samp></big><em id="fhaw1"><noframes id="fhaw1"></noframes></em><strong id="fhaw1"><dl id="fhaw1"><acronym id="fhaw1"><dfn id="fhaw1"></dfn></acronym></dl></strong><small id="fhaw1"><dfn id="fhaw1"><abbr id="fhaw1"></abbr></dfn></small><mark id="fhaw1"></mark><b id="fhaw1"><output id="fhaw1"><abbr id="fhaw1"></abbr></output></b><ins id="fhaw1"></ins><s id="fhaw1"></s><abbr id="fhaw1"><strong id="fhaw1"></strong></abbr><option id="fhaw1"><strong id="fhaw1"></strong></option><legend id="fhaw1"><legend id="fhaw1"><center id="fhaw1"></center></legend></legend><th id="fhaw1"><tfoot id="fhaw1"><progress id="fhaw1"></progress></tfoot></th><rt id="fhaw1"></rt><style id="fhaw1"></style><p id="fhaw1"></p><source id="fhaw1"><wbr id="fhaw1"></wbr></source><em id="fhaw1"></em><cite id="fhaw1"></cite><abbr id="fhaw1"></abbr><strong id="fhaw1"></strong><b id="fhaw1"></b><listing id="fhaw1"><style id="fhaw1"><i id="fhaw1"><dl id="fhaw1"></dl></i></style></listing><tr id="fhaw1"><sup id="fhaw1"><ins id="fhaw1"><video id="fhaw1"></video></ins></sup></tr><u id="fhaw1"></u><ol id="fhaw1"></ol><i id="fhaw1"><s id="fhaw1"><td id="fhaw1"><form id="fhaw1"></form></td></s></i><wbr id="fhaw1"></wbr><pre id="fhaw1"><form id="fhaw1"><label id="fhaw1"><strike id="fhaw1"></strike></label></form></pre><tr id="fhaw1"></tr><rp id="fhaw1"><strong id="fhaw1"></strong></rp><label id="fhaw1"><dl id="fhaw1"></dl></label><legend id="fhaw1"><sub id="fhaw1"><acronym id="fhaw1"></acronym></sub></legend><code id="fhaw1"></code><u id="fhaw1"></u><dfn id="fhaw1"></dfn><form id="fhaw1"><output id="fhaw1"><u id="fhaw1"></u></output></form><source id="fhaw1"><form id="fhaw1"><sub id="fhaw1"><center id="fhaw1"></center></sub></form></source><source id="fhaw1"></source><dfn id="fhaw1"><nav id="fhaw1"><fieldset id="fhaw1"></fieldset></nav></dfn></div>
    
    </html>