久久久精品一区ed2k-女人被男人叉到高潮的视频-中文字幕乱码一区久久麻豆樱花-俄罗斯熟妇真实视频

Android圖表之-Echarts-創(chuàng)新互聯(lián)

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

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

 1.布局文件比較簡單定時3個Button ,和一個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,然后設置一些屬性

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

//進行webwiev的一堆設置

//開啟本地文件讀取(默認為true,不設置也可以)

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");

通過loadUrl加載,myecharts文件

mycharts文件保存在assets目錄下

通過三個按鈕來切換不同的視圖 :

折線圖調(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',]);"); 上面有兩個參數(shù),分別為X,y軸對應的數(shù)據(jù)

其他兩個 :

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

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

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

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

廣告

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

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