<tr id="g00uo"><td id="g00uo"></td></tr>
    <ruby id="g00uo"><tt id="g00uo"></tt></ruby>
  • <strike id="g00uo"><rt id="g00uo"></rt></strike>
    <tr id="g00uo"><strike id="g00uo"></strike></tr>
    \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,應(yīng)該會顯示名稱。<\/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應(yīng)用程序。<\/p>\n

    <\/pre>\n

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

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

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

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

    重新啟動Node服務(wù)器并訪問http:\/\/localhost:8000\/app\/index.html。您應(yīng)該會看到基于我們的虛擬數(shù)據(jù)的折線圖。<\/p>\n

    結(jié)論<\/strong><\/p>

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

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

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

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

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

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

    要將Google Charts與AngularJS一起使用,您可以使用angular-google-charts包。此包提供了一組AngularJS指令,使您可以輕松地將Google Charts集成到您的AngularJS應(yīng)用程序中。要安裝該包,您可以使用以下命令:<\/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作為參數(shù):第一個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)建相應(yī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/" 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="社區(qū)" class="head_nava head_nava-template1">社區(qū)</a>
                        <div   class="wjcelcm34c"   id="dropdown-template1" style="display: none;">
                            <div   id="wjcelcm34c"   class="languagechoose">
                                <a href="http://ipnx.cn/zh/article.html" title="文章" class="languagechoosea on">文章</a>
                                <a href="http://ipnx.cn/zh/faq/zt" title="合集" class="languagechoosea">合集</a>
                                <a href="http://ipnx.cn/zh/wenda.html" title="問答" class="languagechoosea">問答</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="wjcelcm34c"   class="head_navs">
                        <a href="javascript:;" title="學(xué)習(xí)" class="head_nava head_nava-template1_1">學(xué)習(xí)</a>
                        <div   class="wjcelcm34c"   id="dropdown-template1_1" style="display: none;">
                            <div   id="wjcelcm34c"   class="languagechoose">
                                <a href="http://ipnx.cn/zh/course.html" title="課程" class="languagechoosea on">課程</a>
                                <a href="http://ipnx.cn/zh/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/toolset/development-tools" title="開發(fā)工具" class="languagechoosea on">開發(fā)工具</a>
                                <a href="http://ipnx.cn/zh/toolset/website-source-code" title="網(wǎng)站源碼" class="languagechoosea">網(wǎng)站源碼</a>
                                <a href="http://ipnx.cn/zh/toolset/php-libraries" title="PHP 庫" class="languagechoosea">PHP 庫</a>
                                <a href="http://ipnx.cn/zh/toolset/js-special-effects" title="JS特效" class="languagechoosea on">JS特效</a>
                                <a href="http://ipnx.cn/zh/toolset/website-materials" title="網(wǎng)站素材" class="languagechoosea on">網(wǎng)站素材</a>
                                <a href="http://ipnx.cn/zh/toolset/extension-plug-ins" title="擴(kuò)展插件" class="languagechoosea on">擴(kuò)展插件</a>
                            </div>
                        </div>
                    </div>
    
                    <div   id="wjcelcm34c"   class="head_navs">
                        <a href="http://ipnx.cn/zh/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/game" title="游戲下載" class="languagechoosea on">游戲下載</a>
                                <a href="http://ipnx.cn/zh/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')" class="search-input" type="text" autocomplete="off" name="keywords" required="required" placeholder="Block,address,transaction,news" value="">
                    <a href="javascript:;" title="搜索"  onclick="searchs('zh')"><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:;" title="簡體中文" class="languagechoosea">簡體中文</a>
                                                    <a href="javascript:setlang('en');" title="English" class="languagechoosea">English</a>
                                                    <a href="javascript:setlang('zh-tw');" 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">
    							<!-- 左側(cè)懸浮,文章定位標(biāo)題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/" title="首頁"
    							class="phpgenera_Details_mainL1a">首頁</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    												<a href="http://ipnx.cn/zh/web-designer.html"
    							class="phpgenera_Details_mainL1a">web前端</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    												<a href="http://ipnx.cn/zh/js-tutorial.html"
    							class="phpgenera_Details_mainL1a">js教程</a>
    						<img src="/static/imghw/top_right.png" alt="" />
    						<span>使用Google Charts API和AngularJS創(chuàng)建可視化應(yī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)建可視化應(yīng)用程序</h1>
    							<div   id="wjcelcm34c"   class="Articlelist_txts_info_head">
    								<div   id="wjcelcm34c"   class="author_info">
    									<a href="http://ipnx.cn/zh/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/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可用于構(gòu)建利用Google Charts API的動態(tài)可視化應(yīng)用程序。Angular的雙向綁定功能允許圖表根據(jù)數(shù)據(jù)和用戶輸入動態(tài)變化。</li>
    <li>使用AngularJS創(chuàng)建可視化應(yīng)用程序涉及多個步驟,例如設(shè)置Angular、構(gòu)建應(yīng)用程序和創(chuàng)建圖表。此過程需要使用HTML和JavaScript編寫代碼,使用Angular的MVC設(shè)計模式,并集成Google Charts API進(jìn)行可視化。</li>
    <li>Google Charts API提供了各種圖表自定義選項,包括更改顏色、字體和網(wǎng)格線。它還提供交互功能,例如在用戶選擇圖表上的項目時觸發(fā)事件。要將Google Charts與AngularJS一起使用,開發(fā)人員可以使用angular-google-charts包。</li>
    </ul>
    <p>如今,JavaScript無處不在。許多有用的JavaScript框架,如Ember.js、Backbone.js等,正在改變Web的面貌。最流行的框架之一是Google開發(fā)的AngularJS。本文是三篇系列文章中的第一篇,將教你如何使用AngularJS構(gòu)建可視化應(yīng)用程序。示例應(yīng)用程序?qū)⑹褂肎oogle Charts API可視化數(shù)據(jù)。我們將使用Angular令人贊嘆的雙向綁定功能之一,使我們的圖表根據(jù)數(shù)據(jù)和用戶輸入動態(tài)變化。在開始之前,讓我們首先了解如何使用Google Charts API。對于此應(yīng)用程序,我們將堅持使用一些基本圖表,例如折線圖、餅圖等。</p>
    <p><strong>Google Charts</strong></p>
    <p>直接從Google Charts文檔中,以下示例快速回顧了如何使用Google Charts API。第一個腳本加載AJAX API。在第二個腳本中,第一行加載Visualization API和linechart包。第二行設(shè)置一個回調(diào)函數(shù),在Google Visualization API加載時運行?;卣{(diào)函數(shù)創(chuàng)建一個數(shù)據(jù)表,設(shè)置一些圖表選項,實例化我們的圖表并創(chuàng)建圖表。</p>
    <pre class='brush:php;toolbar:false;'><??>
    <??>
    <div id="chart_div" style="width: 900px; height: 500px;"></div></pre>
    <p>如果您不熟悉此API,或者需要復(fù)習(xí),我建議您閱讀Google Charts文檔。</p>
    <p><strong>AngularJS</strong></p>
    <p>在開始使用Angular之前,您應(yīng)該:</p>
    <ul>
    <li>安裝Node.js</li>
    <li>從GitHub克隆種子項目</li>
    </ul>
    <p>從終端導(dǎo)航到種子項目,然后輸入以下命令:</p>
    <pre class='brush:php;toolbar:false;'>cd angular-seed
    node scripts/web-server.js</pre>
    <p>您應(yīng)該看到以下消息輸出到控制臺:</p>
    <pre class="brush:php;toolbar:false"><code>HTTP Server running at http://localhost:8000/</code></pre>
    <p>此時,您可以通過導(dǎo)航到http://localhost:8000/app/index.html查看演示頁面。</p><p>Angular使用MVC(模型-視圖-控制器)設(shè)計模式。在本教程中,我們將重點關(guān)注控制器。目前,可以將控制器視為處理頁面特定部分并使用視圖呈現(xiàn)數(shù)據(jù)的邏輯。一旦我們開始編寫應(yīng)用程序,我們將更好地了解控制器是什么。現(xiàn)在,讓我們看看Angular種子項目。它是一個Angular應(yīng)用程序模板,我們將在此基礎(chǔ)上構(gòu)建我們的應(yīng)用程序。在Angular種子項目中,導(dǎo)航到app/js。在那里,我們可以看到控制器、指令、應(yīng)用程序、過濾器和服務(wù)。這些是我們創(chuàng)建應(yīng)用程序時將要使用的內(nèi)容。</p>
    <p><strong>構(gòu)建應(yīng)用程序</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中找到的控制器函數(shù)的名稱。ng-controller屬性稱為<em>指令</em>。Angular指令用于增強(qiáng)HTML,ng-controller指令用于設(shè)置頁面的特定部分的控制器。{{name}}是用于將數(shù)據(jù)從控制器傳遞到視圖的變量?,F(xiàn)在,問題是如何在MyCtrl1控制器內(nèi)訪問變量name。這就是$scope發(fā)揮作用的地方。$scope是一個對象,充當(dāng)控制器和視圖之間的通信機(jī)制。檢查下面修改后的controllers.js代碼:</p>
    <pre class="brush:php;toolbar:false"><code>HTTP Server running at http://localhost:8000/</code></pre>
    <p>在之前的代碼中,我們正在傳遞$scope作為參數(shù)并設(shè)置變量name。現(xiàn)在,只需使用以下命令重新啟動Node.js服務(wù)器。</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,應(yīng)該會顯示名稱。</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應(yīng)用程序。</p>
    <pre class='brush:php;toolbar:false;'><??></pre>
    <p>angular.bootstrap是一個全局API,用于手動啟動Angular應(yīng)用程序。只需將Google Chart創(chuàng)建代碼復(fù)制并粘貼到控制器函數(shù)中,這就是我們的最終結(jié)果:</p>
    <pre class='brush:php;toolbar:false;'><div ng-controller="MyCtrl1" id="chartdiv"></div></pre>
    <p>在運行代碼之前,編輯index.html并從html標(biāo)簽中刪除ng-app="myApp"。ng-app使用應(yīng)用程序引導(dǎo)元素。但是,由于我們已經(jīng)在控制器代碼中執(zhí)行此操作(使用以下代碼行),因此我們可以將其從HTML中刪除。</p>
    <pre class='brush:php;toolbar:false;'>google.load('visualization', '1', {packages:['corechart']});</pre>
    <p>重新啟動Node服務(wù)器并訪問http://localhost:8000/app/index.html。您應(yīng)該會看到基于我們的虛擬數(shù)據(jù)的折線圖。</p>
    <p><strong>結(jié)論</strong></p><p>在本教程的這一部分中,我們重點介紹了Angular控制器。在下一篇文章中,我們將重點介紹指令和$scope的使用。同時,本文的所有代碼都可以在GitHub上找到。</p>
    <p><strong>使用Google Charts API和AngularJS創(chuàng)建可視化應(yīng)用程序的常見問題解答(FAQ)</strong></p>
    <h3 id="如何自定義Google-Charts的外觀">如何自定義Google Charts的外觀?</h3>
    <p>Google Charts API提供了廣泛的自定義選項,允許您修改圖表的外觀。您可以更改顏色、字體、網(wǎng)格線等等。要自定義圖表,您需要修改圖表draw()方法中的options對象。例如,要更改圖表的標(biāo)題,您可以使用以下代碼:</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>在此示例中,當(dāng)用戶選擇圖表上的項目時,將出現(xiàn)一個警報框,顯示所選項目的value。</p>
    <h3 id="如何將Google-Charts與AngularJS一起使用">如何將Google Charts與AngularJS一起使用?</h3>
    <p>要將Google Charts與AngularJS一起使用,您可以使用angular-google-charts包。此包提供了一組AngularJS指令,使您可以輕松地將Google Charts集成到您的AngularJS應(yīng)用程序中。要安裝該包,您可以使用以下命令:</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作為參數(shù):第一個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)建相應(yī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)建可視化應(yīng)用程序的詳細(xì)內(nèi)容。更多信息請關(guān)注PHP中文網(wǎng)其他相關(guān)文章!</p>
    
    
    						</div>
    					</div>
    					<div   id="wjcelcm34c"   class="wzconShengming_sp">
    						<div   id="wjcelcm34c"   class="bzsmdiv_sp">本站聲明</div>
    						<div>本文內(nèi)容由網(wǎng)友自發(fā)貢獻(xiàn),版權(quán)歸原作者所有,本站不承擔(dān)相應(yīng)法律責(zé)任。如您發(fā)現(xiàn)有涉嫌抄襲侵權(quán)的內(nèi)容,請聯(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/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/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/faq/1796831605.html" title="烏瑪?shù)姆劢z漂亮的德比橫幅日程(2025年7月)" class="phpgenera_Details_mainR4_bottom_title">烏瑪?shù)姆劢z漂亮的德比橫幅日程(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/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/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/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/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/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/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/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title">
    													<h3>Undresser.AI Undress</h3>
    												</a>
    												<p>人工智能驅(qū)動的應(yīng)用程序,用于創(chuàng)建逼真的裸體照片</p>
    											</div>
    										</div>
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh/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/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/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/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title">
    													<h3>Clothoff.io</h3>
    												</a>
    												<p>AI脫衣機(jī)</p>
    											</div>
    										</div>
    																		<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh/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/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/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/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/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/faq/1796831605.html" title="烏瑪?shù)姆劢z漂亮的德比橫幅日程(2025年7月)" class="phpgenera_Details_mainR4_bottom_title">烏瑪?shù)姆劢z漂亮的德比橫幅日程(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/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/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/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/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/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/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/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/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/toolset/development-tools/121" title="禪工作室 13.0.1" class="phpmain_tab2_mids_title">
    													<h3>禪工作室 13.0.1</h3>
    												</a>
    												<p>功能強(qiáng)大的PHP集成開發(fā)環(huán)境</p>
    											</div>
    										</div>
    																			<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh/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/toolset/development-tools/469" title="Dreamweaver CS6" class="phpmain_tab2_mids_title">
    													<h3>Dreamweaver CS6</h3>
    												</a>
    												<p>視覺化網(wǎng)頁開發(fā)工具</p>
    											</div>
    										</div>
    																			<div   id="wjcelcm34c"   class="phpmain_tab2_mids_top">
    											<a href="http://ipnx.cn/zh/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/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/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/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/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/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/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/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請求有三種常用方式:使用內(nèi)置模塊、axios和node-fetch。1.使用內(nèi)置的http/https模塊無需依賴,適合基礎(chǔ)場景,但需手動處理數(shù)據(jù)拼接和錯誤監(jiān)聽,例如用https.get()獲取數(shù)據(jù)或通過.write()發(fā)送POST請求;2.axios是基于Promise的第三方庫,語法簡潔且功能強(qiáng)大,支持async/await、自動JSON轉(zhuǎn)換、攔截器等,推薦用于簡化異步請求操作;3.node-fetch提供類似瀏覽器fetch的風(fēng)格,基于Promise且語法簡單</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh/faq/1796836292.html" title="JavaScript數(shù)據(jù)類型:原始與參考" 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數(shù)據(jù)類型:原始與參考" />
    								</a>
    								<a href="http://ipnx.cn/zh/faq/1796836292.html" title="JavaScript數(shù)據(jù)類型:原始與參考" class="phphistorical_Version2_mids_title">JavaScript數(shù)據(jù)類型:原始與參考</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 13, 2025 am	 02:43 AM</span>
    								<p class="Articlelist_txts_p">JavaScript的數(shù)據(jù)類型分為原始類型和引用類型。原始類型包括string、number、boolean、null、undefined和symbol,其值不可變且賦值時復(fù)制副本,因此互不影響;引用類型如對象、數(shù)組和函數(shù)存儲的是內(nèi)存地址,指向同一對象的變量會相互影響。判斷類型可用typeof和instanceof,但需注意typeofnull的歷史問題。理解這兩類差異有助于編寫更穩(wěn)定可靠的代碼。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh/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/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框架最好?答案是根據(jù)需求選擇最適合的。1.React靈活自由,適合需要高度定制、團(tuán)隊有架構(gòu)能力的中大型項目;2.Angular提供完整解決方案,適合企業(yè)級應(yīng)用和長期維護(hù)的大項目;3.Vue上手簡單,適合中小型項目或快速開發(fā)。此外,是否已有技術(shù)棧、團(tuán)隊規(guī)模、項目生命周期及是否需要SSR也都是選擇框架的重要因素??傊瑳]有絕對最好的框架,適合自己需求的就是最佳選擇。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh/faq/1796832745.html" title="JavaScript時間對象,某人構(gòu)建了一個eactexe,在Google Chrome上更快的網(wǎng)站等等" 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時間對象,某人構(gòu)建了一個eactexe,在Google Chrome上更快的網(wǎng)站等等" />
    								</a>
    								<a href="http://ipnx.cn/zh/faq/1796832745.html" title="JavaScript時間對象,某人構(gòu)建了一個eactexe,在Google Chrome上更快的網(wǎng)站等等" class="phphistorical_Version2_mids_title">JavaScript時間對象,某人構(gòu)建了一個eactexe,在Google Chrome上更快的網(wǎng)站等等</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 08, 2025 pm	 02:27 PM</span>
    								<p class="Articlelist_txts_p">JavaScript開發(fā)者們,大家好!歡迎閱讀本周的JavaScript新聞!本周我們將重點關(guān)注:Oracle與Deno的商標(biāo)糾紛、新的JavaScript時間對象獲得瀏覽器支持、GoogleChrome的更新以及一些強(qiáng)大的開發(fā)者工具。讓我們開始吧!Oracle與Deno的商標(biāo)之爭Oracle試圖注冊“JavaScript”商標(biāo)的舉動引發(fā)爭議。Node.js和Deno的創(chuàng)建者RyanDahl已提交請愿書,要求取消該商標(biāo),他認(rèn)為JavaScript是一個開放標(biāo)準(zhǔn),不應(yīng)由Oracle</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh/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/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中處理異步操作的核心機(jī)制,理解鏈?zhǔn)秸{(diào)用、錯誤處理和組合器是掌握其應(yīng)用的關(guān)鍵。1.鏈?zhǔn)秸{(diào)用通過.then()返回新Promise實現(xiàn)異步流程串聯(lián),每個.then()接收上一步結(jié)果并可返回值或Promise;2.錯誤處理應(yīng)統(tǒng)一使用.catch()捕獲異常,避免靜默失敗,并可在catch中返回默認(rèn)值繼續(xù)流程;3.組合器如Promise.all()(全成功才成功)、Promise.race()(首個完成即返回)和Promise.allSettled()(等待所有完成)</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh/faq/1796832618.html" title="什么是緩存API?如何與服務(wù)人員使用?" 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?如何與服務(wù)人員使用?" />
    								</a>
    								<a href="http://ipnx.cn/zh/faq/1796832618.html" title="什么是緩存API?如何與服務(wù)人員使用?" class="phphistorical_Version2_mids_title">什么是緩存API?如何與服務(wù)人員使用?</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 08, 2025 am	 02:43 AM</span>
    								<p class="Articlelist_txts_p">CacheAPI是瀏覽器提供的一種緩存網(wǎng)絡(luò)請求的工具,常與ServiceWorker配合使用,以提升網(wǎng)站性能和離線體驗。1.它允許開發(fā)者手動存儲如腳本、樣式表、圖片等資源;2.可根據(jù)請求匹配緩存響應(yīng);3.支持刪除特定緩存或清空整個緩存;4.通過ServiceWorker監(jiān)聽fetch事件實現(xiàn)緩存優(yōu)先或網(wǎng)絡(luò)優(yōu)先等策略;5.常用于離線支持、加快重復(fù)訪問速度、預(yù)加載關(guān)鍵資源及后臺更新內(nèi)容;6.使用時需注意緩存版本控制、存儲限制及與HTTP緩存機(jī)制的區(qū)別。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh/faq/1796831296.html" title="利用Array.Prototype方法用于JavaScript中的數(shù)據(jù)操作" 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中的數(shù)據(jù)操作" />
    								</a>
    								<a href="http://ipnx.cn/zh/faq/1796831296.html" title="利用Array.Prototype方法用于JavaScript中的數(shù)據(jù)操作" class="phphistorical_Version2_mids_title">利用Array.Prototype方法用于JavaScript中的數(shù)據(jù)操作</a>
    								<span id="wjcelcm34c"    class="Articlelist_txts_time">Jul 06, 2025 am	 02:36 AM</span>
    								<p class="Articlelist_txts_p">JavaScript數(shù)組內(nèi)置方法如.map()、.filter()和.reduce()可簡化數(shù)據(jù)處理;1).map()用于一對一轉(zhuǎn)換元素生成新數(shù)組;2).filter()按條件篩選元素;3).reduce()用于聚合數(shù)據(jù)為單一值;使用時應(yīng)避免誤用導(dǎo)致副作用或性能問題。</p>
    							</div>
    														<div   id="wjcelcm34c"   class="phphistorical_Version2_mids">
    								<a href="http://ipnx.cn/zh/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/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é)調(diào)調(diào)用棧、WebAPI和任務(wù)隊列來管理異步操作。1.調(diào)用棧執(zhí)行同步代碼,遇到異步任務(wù)時交由WebAPI處理;2.WebAPI在后臺完成任務(wù)后將回調(diào)放入相應(yīng)的隊列(宏任務(wù)或微任務(wù));3.事件循環(huán)檢查調(diào)用棧是否為空,若為空則從隊列中取出回調(diào)推入調(diào)用棧執(zhí)行;4.微任務(wù)(如Promise.then)優(yōu)先于宏任務(wù)(如setTimeout)執(zhí)行;5.理解事件循環(huán)有助于避免阻塞主線程并優(yōu)化代碼執(zhí)行順序。</p>
    							</div>
    													</div>
    
    													<a href="http://ipnx.cn/zh/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培訓(xùn),幫助PHP學(xué)習(xí)者快速成長!</p>
            </div>
            <div   id="wjcelcm34c"   class="footermid">
                <a href="http://ipnx.cn/zh/about/us.html">關(guān)于我們</a>
                <a href="http://ipnx.cn/zh/about/disclaimer.html">免責(zé)聲明</a>
                <a href="http://ipnx.cn/zh/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="amxg6" class="pl_css_ganrao" style="display: none;"><font id="amxg6"><meter id="amxg6"><td id="amxg6"></td></meter></font><label id="amxg6"><em id="amxg6"><output id="amxg6"><blockquote id="amxg6"></blockquote></output></em></label><sub id="amxg6"><big id="amxg6"><acronym id="amxg6"><cite id="amxg6"></cite></acronym></big></sub><pre id="amxg6"></pre><center id="amxg6"><dl id="amxg6"></dl></center><fieldset id="amxg6"></fieldset><mark id="amxg6"><dd id="amxg6"><tbody id="amxg6"></tbody></dd></mark><rp id="amxg6"></rp><label id="amxg6"><abbr id="amxg6"></abbr></label><li id="amxg6"><b id="amxg6"><center id="amxg6"></center></b></li><strike id="amxg6"></strike><form id="amxg6"></form><th id="amxg6"></th><i id="amxg6"></i><tbody id="amxg6"><noframes id="amxg6"><kbd id="amxg6"></kbd></noframes></tbody><dd id="amxg6"></dd><sub id="amxg6"></sub><strong id="amxg6"><small id="amxg6"><kbd id="amxg6"><acronym id="amxg6"></acronym></kbd></small></strong><pre id="amxg6"><samp id="amxg6"><tbody id="amxg6"><thead id="amxg6"></thead></tbody></samp></pre><code id="amxg6"></code><table id="amxg6"></table><table id="amxg6"></table><sub id="amxg6"></sub><dd id="amxg6"></dd><tbody id="amxg6"><noframes id="amxg6"></noframes></tbody><th id="amxg6"><kbd id="amxg6"></kbd></th><abbr id="amxg6"><rp id="amxg6"><delect id="amxg6"><tr id="amxg6"></tr></delect></rp></abbr><var id="amxg6"></var><ul id="amxg6"><center id="amxg6"><dd id="amxg6"><acronym id="amxg6"></acronym></dd></center></ul><delect id="amxg6"></delect><strike id="amxg6"></strike><tbody id="amxg6"><p id="amxg6"><sup id="amxg6"></sup></p></tbody><u id="amxg6"></u><pre id="amxg6"><td id="amxg6"><ol id="amxg6"><code id="amxg6"></code></ol></td></pre><strong id="amxg6"><tbody id="amxg6"><ul id="amxg6"></ul></tbody></strong><center id="amxg6"></center><i id="amxg6"><optgroup id="amxg6"><nav id="amxg6"><option id="amxg6"></option></nav></optgroup></i><sup id="amxg6"></sup><font id="amxg6"></font><fieldset id="amxg6"><menu id="amxg6"></menu></fieldset><track id="amxg6"></track><progress id="amxg6"></progress><code id="amxg6"></code><legend id="amxg6"><optgroup id="amxg6"><li id="amxg6"></li></optgroup></legend><tr id="amxg6"></tr><fieldset id="amxg6"></fieldset><th id="amxg6"><small id="amxg6"><font id="amxg6"><tr id="amxg6"></tr></font></small></th><big id="amxg6"><tbody id="amxg6"></tbody></big><li id="amxg6"><ul id="amxg6"><pre id="amxg6"></pre></ul></li><tfoot id="amxg6"></tfoot></div>
    
    </html>