wylyl22 3 years ago
parent 5c90e5cff2
commit d7401350fa

@ -1,6 +1,6 @@
// 单柱状
import {doStr} from "./text"
export default function histogram(dx = [], ds = [], color1 = '', direction = true) {
export default function histogram(dx = [], ds = [], color1 = '', direction = true,length=0) {
// direction true为垂直 false为水平
return {
tooltip: {
@ -26,7 +26,7 @@ export default function histogram(dx = [], ds = [], color1 = '', direction = tru
yAxisIndex:[0],
// left:"93%",
start:0,
end:40,
end:length,
// handleSize: 30
}],
// legend: {

@ -117,6 +117,7 @@ Page({
sPriceType: this.data.sPriceType,
sEnergyType: this.data.sEnergyType
}
let length=0
//第一次加载数据
if (iPageIndex == 1) {
this.setData({
@ -125,9 +126,6 @@ Page({
})
}
app.globalData.request(obj,(database)=>{
this.setData({
// ranking1:database.Data,
})
}).then(res => {
const carName=[]
const carValue=[]
@ -140,10 +138,12 @@ Page({
carName.push(e.seriesname)
carValue.push(e.salescount)
})
// length=(carName.length/carName.length)*100
// console.log(carName.length)
this.setData({
ranking: list, //获取数据数组
loadMore: false,//把"上拉加载"的变量设为false显示
brandOption:histogram(carName,carValue,'#0084FF',false)
brandOption:histogram(carName,carValue,'#0084FF',false,(20/list.length)*100)
});
if (res.length < iPageSize) {
this.setData({
@ -411,6 +411,7 @@ Page({
})
},
//弹出框
popup(e) {
let duration = this.data.duration
let models = e.currentTarget.dataset.car

Loading…
Cancel
Save