import * as echarts from '../../ec-canvas/echarts'; var app = getApp() function initChart(canvas, width, height, dpr, data) { const chart = echarts.init(canvas, null, { width: width, height: height, devicePixelRatio: dpr // new }); canvas.setChart(chart); console.log(dpr) console.log(data) var option = { xAxis : { type : 'category', splitNumber: 2, scale: true, show:false, splitLine:{     show:false   } }, yAxis : { type : 'value', splitNumber: 2, scale: true, show:false, splitLine:{     show:false    } }, series: [{ type: 'line', smooth: true, data:data, areaStyle: {}, }] }; chart.setOption(option); return chart; } Page({ data: { // 页面配置 winWidth: 0, winHeight: 0, // tab切换 currentTab: 0, ec: { onInit: initChart }, array:[ { title:'AppL', subtitle:"APPL INC", Increase:"1.22", digital:"33", data:[52,56,355,444] }, { title:'AppL', subtitle:"APPL INC", Increase:"1.22", digital:"33", data:[52,56,355,444] }, { title:'AppL', subtitle:"APPL INC", Increase:"1.22", digital:"33", data:[52,56,355,44554] } ], }, onLoad: function() { var that = this; // 获取系统信息 wx.getSystemInfo({ success: function(res) { that.setData({ winWidth: res.windowWidth, winHeight: res.windowHeight }); } }); }, // 滑动切换tab bindChange: function(e) { var that = this; that.setData({ currentTab: e.detail.current }); }, // 点击tab切换 swichNav: function(e) { var that = this; if (this.data.currentTab === e.target.dataset.current) { return false; } else { that.setData({ currentTab: e.target.dataset.current }) } } })