dev
xiaowen 3 years ago
parent bf556dc308
commit b509a3a69e

@ -1,6 +1,5 @@
const app = getApp();
import brokenLine from "../../option/stackingLineOption"
const dName = ['微博', '其他', '短视频', '微信', 'APP', '论坛', '新闻']
const dColor = ['#FF4852', '#FF6E25', '#FFBF00', '#20CC62', '#00D6D6', '#00AAFF', '#7257FF']
Component({
data: {
@ -30,8 +29,6 @@ Component({
let sTimeType = e.detail.sTimeType;
let sStartTime = e.detail.sStartTime;
let sEndTime = e.detail.sEndTime;
// this.getAmount(sTimeType, sStartTime, sEndTime);
// this.getTrend(sTimeType, sStartTime, sEndTime);
this.getData(sTimeType, sStartTime, sEndTime)
},
@ -61,17 +58,30 @@ Component({
sEndTime: sEndTime
}
app.globalData.request(obj).then(res => {
let arr = []
let bar = [[],[],[],[],[],[]
]
res.forEach(ele => {
for (let i = 0; i < ele.Data.length; i++) {
bar[i].push(ele.Data[i].value)
let data = res || [];
let times = []
let dNameObj = {}
for(let i = 0; i < data.length; i++) {
times.push(data[i].Time);
let a1 = data[i].Data || [];
for(let j = 0; j < a1.length; j++) {
let row = a1[j];
if(dNameObj[row.key]) {
let val = dNameObj[row.key];
val.push(row.value);
} else {
dNameObj[row.key] = [row.value];
}
}
arr.push(ele.Time)
})
}
const bar = [];
const dName = [];
for(let key in dNameObj) {
dName.push(key);
bar.push(dNameObj[key])
}
this.setData({
dataOption: brokenLine(dName, bar, dColor, arr),
dataOption: brokenLine(dName, bar, dColor, times)
})
resolve(true)
}).catch(() => {

@ -4,13 +4,16 @@ export default function histogram(dx = [], ds = [], color1 = '', direction = tru
// direction true为垂直 false为水平
return {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
confine: true
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
},
dataZoom: direction?[{ //添加X轴滚动条
type: 'inside',
show: false,

@ -1,7 +1,17 @@
// 象形
export default function pictographicOption(dRegion = [], dValue = [], dSum = 0) {
return {
tooltip: {},
tooltip: {
trigger: "item",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
},
xAxis: {
show: false,
type: 'value'

@ -2,7 +2,15 @@
export default function pieOption(color = [], data = [], ) {
return {
tooltip: {
trigger: 'item'
trigger: 'item',
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
},
// 注释字体样式
legend: {

@ -3,11 +3,15 @@ export default function sHistogram(dx = [], ds = [], data = [], color2 = []) {
// MS判断多条数据还是单条数据 true为单条false为多条
return {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
},
confine: true
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
},
legend: {
icon: 'rectangle', //data图标样式

@ -2,11 +2,15 @@
export default function brokenLines(dName = [], dValue = [], dColor = [], dx = []) {
return {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'line' // 默认为直线,可选为:'line' | 'shadow'
},
confine: true
trigger: "axis",
backgroundColor: "#08182F",
color: "#fff",
borderColor: "#3373CC",
textStyle: {
color: "#fff", //设置文字颜色
},
extraCssText: "box-shadow: 0px 0px 10px 0px #3373CC;",
confine: true
},
legend: {
icon: 'rectangle', //data图标样式

@ -120,7 +120,6 @@ Page({
})
}
app.globalData.request(obj, (database) => {
console.log('54321',database)
this.setData({
totalNum: database.totalNum
})

Loading…
Cancel
Save