liuyongli 3 years ago
commit d0f2ee26a4

@ -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: {
@ -10,6 +10,7 @@ export default function histogram(dx = [], ds = [], color1 = '', direction = tru
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
@ -26,7 +27,7 @@ export default function histogram(dx = [], ds = [], color1 = '', direction = tru
yAxisIndex:[0],
// left:"93%",
start:0,
end:40,
end:length,
// handleSize: 30
}],
// legend: {

@ -8,6 +8,7 @@ export default function pictographicOption(dRegion = [], dValue = [], dSum = 0)
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true

@ -8,6 +8,7 @@ export default function pieOption(color = [], data = [], ) {
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true

@ -9,6 +9,7 @@ export default function sHistogram(dx = [], ds = [], data = [], color2 = []) {
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true

@ -8,6 +8,7 @@ export default function brokenLines(dName = [], dValue = [], dColor = [], dx = [
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
fontSize: 9
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true,

@ -2,6 +2,7 @@
const app = getApp()
import brokenLine from "../../../components/option/singleLineOption"
import histogram from "../../../components/option/columnarOption"
import {times} from "../../../components/option/text"
import moment from "moment"
let iPageIndex = 1 // 当前第几页,0代表第一页
let iPageSize =20 //每页显示多少数据
@ -116,6 +117,7 @@ Page({
sPriceType: this.data.sPriceType,
sEnergyType: this.data.sEnergyType
}
let length=0
//第一次加载数据
if (iPageIndex == 1) {
this.setData({
@ -124,9 +126,6 @@ Page({
})
}
app.globalData.request(obj,(database)=>{
this.setData({
// ranking1:database.Data,
})
}).then(res => {
const carName=[]
const carValue=[]
@ -139,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({
@ -260,7 +261,7 @@ Page({
bindShowMsg(e) {
var id = e.currentTarget.id
if (id == 1) {
this.data.Stats1=2
this.data.Stats1=3
this.setData({
select1: !this.data.select1,
select2: false,
@ -270,7 +271,7 @@ Page({
font1:this.getFont(this.data.Stats1)
})
} else if (id == 2) {
this.data.Stats2=2
this.data.Stats2=3
this.setData({
select2: !this.data.select2,
select1: false,
@ -280,7 +281,7 @@ Page({
font2:this.getFont(this.data.Stats2)
})
} else if (id == 3) {
this.data.Stats3=2
this.data.Stats3=3
this.setData({
select3: !this.data.select3,
select2: false,
@ -290,7 +291,7 @@ Page({
font3:this.getFont(this.data.Stats3)
})
} else if (id == 4) {
this.data.Stats4=2
this.data.Stats4=3
this.setData({
select4: !this.data.select4,
select1: false,
@ -410,31 +411,7 @@ Page({
})
},
//弹出框
times(val){
var month=val.substring(0,4) //获取年份
var bYear=val.substring(val.length-2,val.length-1)=="0"//是否为带零的月份
var year1=val.substring(val.length-1,val.length) //获取月份最后一个数
var year2=val.substring(val.length-2,val.length) //获取整个月份
var time,months,years
if(bYear){
if(parseInt(year1)<6){
months=parseInt(month-1)
if(parseInt(year1)<3){
years="0"+((12-(6-parseInt(year1)))+1)
}else{
years=(12-(6-parseInt(year1)))+1
}
}else{
months=month
years="0"+((parseInt(year1)-6)+1)
}
}else{
months=month
years="0"+(parseInt(year2)-6+1)
}
time=months+'-'+years
return time
},
popup(e) {
let duration = this.data.duration
let models = e.currentTarget.dataset.car
@ -442,7 +419,7 @@ Page({
action:"getCheZhuCarSeriesListHome",
sType:"Marketing",
sSeriesName:models,
sStartTime:this.times(this.data.date),
sStartTime:times(this.data.date),
sEndTime: this.data.date,
}).then(res => {
// console.log(res)

@ -28,7 +28,6 @@
line-height: 60rpx;
font-size: 24rpx;
text-align: center;
/* background: #02ffd5; */
border: 1rpx solid #F9F9F9;
}
@ -39,18 +38,8 @@
line-height: 60rpx;
font-size: 24rpx;
text-align: center;
/* background: #02ffd5; */
border: 1rpx solid #F9F9F9;
}
.font30 {
font-size: 30rpx;
}
.color3 {
color: #333;
}
.color6 {
color: #000;
font-size: 24rpx;
@ -237,7 +226,6 @@
/* 顶部 */
.top text {
font-size: 24rpx;
/* color: #333333; */
}
.top .timeIcon {
@ -257,19 +245,14 @@
.all1 {
width: 150rpx;
height: 60rpx;
/* display: flex; */
/* float: right; */
/* align-items: center; */
/* justify-content:space-between; */
border: 1px solid #027AFF;
border: 1px solid #027AFF ;
padding: 0 10rpx;
background-color: #027AFF;
background-color: #ffffff;
font-size: 24rpx;
text-align: center;
color: #FFFFFF;
}
.noall {
color: #027AFF;
}
.noall{
width: 150rpx;
height: 60rpx;
text-align: center;
@ -288,31 +271,30 @@
.top-noselected {
width: 150rpx;
height: 60rpx;
display: flex;
/* display: flex;
align-items: center;
justify-content: space-between;
justify-content: space-between; */
border: 1px solid #f9f9f9;
padding: 0 10rpx;
font-size: 24rpx;
background-color: #ffffff;
}
/* 选中 */
.top-selecteds {
width: 150rpx;
height: 60rpx;
display: flex;
/* float: right; */
align-items: center;
justify-content: space-between;
border: 1px solid #027AFF;
padding: 0 10rpx;
font-size: 24rpx;
background-color: #fff;
}
/* 选择中 */
.top-selected {
}
/* 选中 */
.top-selecteds{
width: 150rpx;
height: 60rpx;
display: flex;
/* margin-top: 10rpx; */
/* float: right; */
align-items: center;
justify-content:space-between;
border: 1px solid #027AFF ;
padding: 0 10rpx;
font-size: 24rpx;
background-color: #fff;
}
/* 选择中 */
.top-selected{
width: 150rpx;
height: 60rpx;
display: flex;
@ -324,8 +306,8 @@
background-color: #027AFF;
}
.title {
color: #000;
.title{
color: #fff;
font-size: 24rpx
}
@ -334,45 +316,41 @@
font-size: 24rpx
}
.notitle {
color: #fff;
.notitle{
color: #000;
font-size: 24rpx
}
/* 下拉内容 */
.select_box {
background-color: #fff;
/* padding: 0 20rpx; */
width: 100%;
float: inline-end;
position: fixed;
right: 0;
z-index: 99;
overflow: hidden;
text-align: center;
animation: myfirst 0.5s;
font-size: 24rpx;
}
.select_one {
padding-left: 20rpx;
width: 100%;
height: 60rpx;
position: relative;
line-height: 60rpx;
}
/* 下拉过度效果 */
@keyframes myfirst {
from {
height: 0rpx;
}
to {
height: 210rpx;
}
}
/* 下拉内容 */
.select_box {
background-color: #fff;
/* padding: 0 20rpx; */
width: 100%;
float:inline-end;
position:fixed;
right: 0;
z-index: 99;
overflow: hidden;
text-align:center;
animation: myfirst 0.5s;
font-size: 24rpx;
}
.select_one {
padding-left: 20rpx;
width: 100%;
height: 60rpx;
position: relative;
line-height: 60rpx;
}
/* 下拉过度效果 */
@keyframes myfirst {
from {
height: 0rpx;
}
to {
height: 210rpx;
}
}
.loading {
position: relative;
bottom: 5rpx;

Loading…
Cancel
Save