1. 程式人生 > 其它 >小白筆記:微信小程式中使用echarts圖表實操記錄

小白筆記:微信小程式中使用echarts圖表實操記錄

做了個小程式中用echarts圖表的例子。下載的Demo中,資料方法是寫在Page外面,本人實力不夠短時間內沒搞定資料渲染。最終換了個方法完成的,記錄一下,下次再遇到可以複習借鑑。

首先,echarts適合微信小程式的在github上下載:https://github.com/ecomfe/echarts-for-weixin

.json:usingComponents中如下圖引用

wxss:樣式可以自由定義

wxml:

js:主要是js廢了點時間

{ "usingComponents":{ "ec-canvas":"../../../../../components/ec-canvas/ec-canvas
" }, "navigationBarBackgroundColor":"#FAF9F9", "navigationBarTextStyle":"black", "backgroundTextStyle":"light", "navigationBarTitleText":"驗光檔案", "enablePullDownRefresh":false, "backgroundColorTop":"#FAF9F9", "backgroundColorBottom":"#F2F2F2" }