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.

61 lines
1.8 KiB

const app = getApp();
import sHistogram from "../../option/sColumnarOption"
// const dx=['长安','大众','丰田','吉利','哈佛']
const dx = []
const ds=[]
// [1400, 2400, 1000, 2800, 1000, 400, 1200],
// [100, 2000, 1500, 1800, 1490, 900, 310],
// [1400, 200, 150, 1340, 1600, 1900, 1310],
// [6545, 3456, 1500, 4500, 1700, 1900, 3100],
// [3123, 2313, 313, 4355, 1490, 2900, 2310],
// [1400, 5434, 1544, 533, 1454, 1900, 3310],
// [1400, 5434, 1544, 533, 1454, 1900, 3310],]
const data=['微博','其他','短视频','微信','APP','论坛','新闻']
// const data = []
const color2=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF']
Component({
data: {
showChart: true,
brandOption:sHistogram(dx,ds,data,color2),
modelOption: sHistogram(dx,ds,data,color2)
},
onShow() {
this.getTabBar().init();
},
lifetimes: {
attached() {
app.globalData.request({action: 'getHomeBrandSourceType0528', sType: 'Home', sTimeType: 34, sQueryType: 2}).then(res => {
const arr = []
res.forEach(ele => {
let ol = {
dx:ele.key
}
ele.value.forEach(val =>{
let obj = {
ds:val.value,
data:val.key
}
arr.push(obj)
})
arr.push(ol)
})
this.setData({
brandOption: arr,
})
console.log('111',arr)
})
},
},
methods: {
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
},
}
})