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.

71 lines
2.3 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 = []
const arr1=[]
const arr2=[]
const arr3=[]
const arr4=[]
res.forEach(ele => {
// let ol = {
// dx:ele.key
// }
arr.push(ele.key)
ele.value.forEach(val =>{
arr1.push(val.value)
arr2.push(val.key)
})
// arr.push(ol)
})
// for (let index = 0; index < 7; index++) {
// arr3.push(arr2[index])
// }
for (let index = 0; index < 7; index++) {
arr3.push(arr2[index])
}
this.setData({
brandOption:sHistogram(arr,arr1,arr3,color2),
})
console.log('111',arr)
console.log('111',arr1)
console.log('111',arr3)
})
},
},
methods: {
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
},
}
})