<del id="d4fwx"><form id="d4fwx"></form></del>
      <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

            <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
          • Android圖表之-Echarts-創(chuàng)新互聯(lián)

            ECharts是一款開源、功能強(qiáng)大的數(shù)據(jù)可視化產(chǎn)品,緊跟著大數(shù)據(jù)時(shí)代的步伐,是我接觸過(guò)的最優(yōu)秀的可視化工具,也是進(jìn)步最快的軟件,希望它早日成為世界級(jí)的開源項(xiàng)目,之前使用過(guò)MPAndroidChart,achartengine 等android下的圖形圖標(biāo),相對(duì)而言Echart樣式更多,通過(guò)JS的形式來(lái)實(shí)現(xiàn)還是第一次見 ,話不多說(shuō)直接上代碼

            專注于為中小企業(yè)提供網(wǎng)站設(shè)計(jì)制作、做網(wǎng)站服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)古交免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過(guò)網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

             1.布局文件比較簡(jiǎn)單定時(shí)3個(gè)Button ,和一個(gè)Webview :

              <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

              xmlns:tools="http://schemas.android.com/tools"

              android:layout_width="match_parent"

              android:layout_height="match_parent"

              android:paddingBottom="@dimen/activity_vertical_margin"

              android:paddingLeft="@dimen/activity_horizontal_margin"

              android:paddingRight="@dimen/activity_horizontal_margin"

              android:paddingTop="@dimen/activity_vertical_margin"

              tools:context="com.hzbst.echartst.MainActivity" >

            <LinearLayout

               android:id="@+id/bt_ly"

               android:layout_width="match_parent"

                android:layout_height="wrap_content"

                android:gravity="center_horizontal"

               >

            <Button

               android:id="@+id/linechart_bt"

               android:layout_width="match_parent"

               android:layout_height="wrap_content"

               android:layout_weight="1"

               android:text="折線圖" />

            <Button

               android:id="@+id/barchart_bt"

               android:layout_width="match_parent"

               android:layout_height="wrap_content"

               android:layout_weight="1"

               android:text="柱狀圖" />

            <Button

               android:id="@+id/piechart_bt"

               android:layout_width="match_parent"

               android:layout_height="wrap_content"

               android:layout_weight="1"

               android:text="餅狀圖" />

            </LinearLayout>

            <WebView

               android:id="@+id/chartshow_wb"

               android:layout_width="match_parent"

               android:layout_height="match_parent"

               android:layout_alignRight="@+id/bt_ly"

               android:layout_below="@+id/bt_ly"

               android:layout_marginTop="43dp" />

            </RelativeLayout>

            2. 在代碼中去架子Echarts圖形

             MainActivity類

            找到Webview,然后設(shè)置一些屬性

            chartshow_wb=(WebView)findViewById(R.id.chartshow_wb);

            //進(jìn)行webwiev的一堆設(shè)置

            //開啟本地文件讀?。J(rèn)為true,不設(shè)置也可以)

            chartshow_wb.getSettings().setAllowFileAccess(true);

            //開啟腳本支持

            chartshow_wb.getSettings().setJavaScriptEnabled(true);

            chartshow_wb.getSettings().setSupportZoom(true);

            chartshow_wb.getSettings().setBuiltInZoomControls(true);

            chartshow_wb.loadUrl("file:///android_asset/echart/myechart.html");

            通過(guò)loadUrl加載,myecharts文件

            mycharts文件保存在assets目錄下

            通過(guò)三個(gè)按鈕來(lái)切換不同的視圖 :

            折線圖調(diào)用:chartshow_wb.loadUrl("javascript:createChart('line',[29.2,29.2,29.2,29.2,29.2,29.1,29.1,]," +

            "['2017-05-22','2017-05-22','2017-05-22','2017-05-22','2017-05-22','2017-05-22','2017-05-22',]);"); 上面有兩個(gè)參數(shù),分別為X,y軸對(duì)應(yīng)的數(shù)據(jù)

            其他兩個(gè) :

            chartshow_wb.loadUrl("javascript:createChart('bar',[100,100,100]);");

            chartshow_wb.loadUrl("javascript:createChart('pie",[100,100,100]);");

            這樣就可以了

            源代碼下載地址:http://down.51cto.com/data/2309209

            附件:http://down.51cto.com/data/2366697

            另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

            文章題目:Android圖表之-Echarts-創(chuàng)新互聯(lián)
            當(dāng)前路徑:http://www.jbt999.com/article42/eooec.html

            成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)響應(yīng)式網(wǎng)站、網(wǎng)頁(yè)設(shè)計(jì)公司、網(wǎng)站營(yíng)銷、網(wǎng)站策劃、企業(yè)網(wǎng)站制作

            廣告

            聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

            成都網(wǎng)站建設(shè)公司

              <del id="d4fwx"><form id="d4fwx"></form></del>
              <del id="d4fwx"><form id="d4fwx"></form></del><del id="d4fwx"><form id="d4fwx"></form></del>

                    <code id="d4fwx"><abbr id="d4fwx"></abbr></code>
                  • 美女大黄视频 | 亚洲精品黄片 | 91蜜桃在线观看 | 91这里只有精品视频 | 国产精品成人熊猫视频成人在线播放 |