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

3 years ago
const app = getApp();
3 years ago
import sHistogram from "../../option/sColumnarOption"
3 years ago
// 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],]
3 years ago
// const data=['微博','其他','短视频','微信','APP','论坛','新闻']
const data = []
3 years ago
const color2=['#FF4852','#FF6E25','#FFBF00','#20CC62','#00D6D6','#00AAFF','#7257FF']
3 years ago
Component({
data: {
3 years ago
showChart: true,
3 years ago
brandOption:sHistogram(dx,ds,data,color2),
modelOption: sHistogram(dx,ds,data,color2)
3 years ago
},
3 years ago
onShow() {
this.getTabBar().init();
3 years ago
3 years ago
},
3 years ago
lifetimes: {
attached() {
app.globalData.request({action: 'getHomeBrandSourceType0528', sType: 'Home', sTimeType: 34, sQueryType: 2}).then(res => {
const arr = []
3 years ago
const arr1=[]
const arr2=[]
const arr3=[]
const arr4=[]
3 years ago
res.forEach(ele => {
3 years ago
// let ol = {
// dx:ele.key
// }
arr.push(ele.key)
3 years ago
ele.value.forEach(val =>{
3 years ago
arr1.push(val.value)
arr2.push(val.key)
3 years ago
})
3 years ago
// arr.push(ol)
3 years ago
})
3 years ago
// for (let index = 0; index < 7; index++) {
// arr3.push(arr2[index])
// }
for (let index = 0; index < 7; index++) {
arr3.push(arr2[index])
}
3 years ago
this.setData({
3 years ago
brandOption:sHistogram(arr,arr1,arr3,color2),
3 years ago
})
console.log('111',arr)
3 years ago
console.log('111',arr1)
console.log('111',arr3)
3 years ago
})
},
},
3 years ago
3 years ago
methods: {
priceSel(e){
this.setData({
intervalSel: e.currentTarget.dataset.index
})
3 years ago
},
3 years ago
}
})