|
|
|
@ -11,8 +11,8 @@ const ds=[]
|
|
|
|
|
// [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 data=['微博','其他','短视频','微信','APP','论坛','新闻']
|
|
|
|
|
const data = []
|
|
|
|
|
const color2=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF']
|
|
|
|
|
|
|
|
|
|
Component({
|
|
|
|
@ -30,23 +30,33 @@ Component({
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
// let ol = {
|
|
|
|
|
// dx:ele.key
|
|
|
|
|
// }
|
|
|
|
|
arr.push(ele.key)
|
|
|
|
|
ele.value.forEach(val =>{
|
|
|
|
|
let obj = {
|
|
|
|
|
ds:val.value,
|
|
|
|
|
data:val.key
|
|
|
|
|
}
|
|
|
|
|
arr.push(obj)
|
|
|
|
|
arr1.push(val.value)
|
|
|
|
|
arr2.push(val.key)
|
|
|
|
|
})
|
|
|
|
|
arr.push(ol)
|
|
|
|
|
// 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: arr,
|
|
|
|
|
brandOption:sHistogram(arr,arr1,arr3,color2),
|
|
|
|
|
})
|
|
|
|
|
console.log('111',arr)
|
|
|
|
|
console.log('111',arr1)
|
|
|
|
|
console.log('111',arr3)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|