import histogram from "../option/columnarOption" const app = getApp() Component({ data: { showChart: true, }, // onShow() { // this.getTabBar().init(); // }, lifetimes:{ attached(){ this.getTrend() } }, methods: { getTrend(){ app.globalData.request({ action: 'getCheZhuCarSeriesRankingHome', sType:'Marketing', sStartTime: "2021-10", sEndTime:"2021-10", iPageIndex: "iPageIndex", iPageSize: "iPageSize", // sSpec:wx.getStorageSync('sSpec') || '', // sPriceType:wx.getStorageSync('sPriceType') || '', // sEnergyType:wx.getStorageSync('sEnergyType') || '' }).then(res => { let carName = [] let carValue=[] res.forEach(e =>{ carName.push(e.seriesname), carValue.push(e.salescount) }) this.setData({ brandOption: histogram(carName,carValue,'#0084FF',false) }) })}, priceSel(e){ this.setData({ intervalSel: e.currentTarget.dataset.index }) } } })