You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

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=[]
let carName1 = []
let carValue1=[]
res.forEach(e =>{
carName.push(e.seriesname),
carValue.push(e.salescount)
})
console.log(carValue)
console.log(carName)
let a=0
for(let i=carName.length; i>0;i--){
a++
carName1.push(carName[i-1])
carValue1.push(carValue[i-1])
}
console.log(carValue1)
console.log(carName1)
console.log(a)
this.setData({
brandOption: histogram(carName1,carValue1,'#0084FF',false)
})
})},
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
}
}
})