antv/f2 wepy
antv/f2 小程序 wepy 组件版本
使用
安装
npm install wepy-antv-f2
template
<!-- 这里的长宽属性 是按照 iPhone6 作为设计稿标准(宽度750px) -->
script
;// antv f2 抽离到 mini-program-utils, 都经过babel 编译; let chart = null; const initChart = { const data = year: '1951 年' sales: 38 year: '1952 年' sales: 52 year: '1956 年' sales: 61 year: '1957 年' sales: 145 year: '1958 年' sales: 48 year: '1959 年' sales: 38 year: '1960 年' sales: 38 year: '1962 年' sales: 38 ; chart = el: canvas width height ; chartsourcedata sales: tickCount: 5 ; chart; chart; chart; return chart;}; page components = F2Canvas ; data = opts: onInit: initChart ;