|
|
@ -261,8 +261,7 @@ function ParkingAlyPeriod() { |
|
|
|
this.random(arr) |
|
|
|
} |
|
|
|
} |
|
|
|
const color = ['#5470c6','#91cc75','#fac858','#ee6666','#73c0de','#fc8452','#3ba272','#9a60b4','#ee7ccc'] |
|
|
|
console.log(Math.round(Math.random()*10)) |
|
|
|
const color = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#fc8452', '#3ba272', '#9a60b4', '#ee7ccc'] |
|
|
|
//停车饱和趋势分析分析 折线图 hour 时间对比 |
|
|
|
const getParkOptionHour = (data) => { |
|
|
|
console.log(data) |
|
|
@ -277,7 +276,7 @@ function ParkingAlyPeriod() { |
|
|
|
); |
|
|
|
// 构建数据对象 |
|
|
|
let seriesData = areaNames.map((areaName, index) => { |
|
|
|
let color2 = color[Math.round(Math.random()*10)] |
|
|
|
let color2 = color[Math.round(Math.random() * 10)] |
|
|
|
// 获取数据 |
|
|
|
let areaData = data[0].date ? data.filter((item) => item.date === areaName) : data |
|
|
|
// 构建数据对象 |
|
|
@ -293,8 +292,8 @@ function ParkingAlyPeriod() { |
|
|
|
}, |
|
|
|
normal: { |
|
|
|
color: color2, //改变折线点的颜色 |
|
|
|
lineStyle:{ |
|
|
|
color:color2, |
|
|
|
lineStyle: { |
|
|
|
color: color2, |
|
|
|
} |
|
|
|
//改变折线颜色 |
|
|
|
} |
|
|
@ -320,13 +319,7 @@ function ParkingAlyPeriod() { |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
setHourData({ |
|
|
|
...lineChartOption(areaNames, xAxisData, "饱和度", seriesData), |
|
|
|
// tooltip: { |
|
|
|
// trigger: "axis", |
|
|
|
// formatter: "{a}<br/>{b}:{c}", |
|
|
|
// }, |
|
|
|
}); |
|
|
|
setHourData({ ...lineChartOption(areaNames, xAxisData, "饱和度", seriesData) }); |
|
|
|
}; |
|
|
|
function getParkingIncome(data) { |
|
|
|
ajax |
|
|
@ -346,8 +339,8 @@ function ParkingAlyPeriod() { |
|
|
|
if (res.status === 20000) { |
|
|
|
getParkOption(res.data.list?.area_list); |
|
|
|
setKeyVal(res.data.list?.hour_list.length) |
|
|
|
setHourData({}) |
|
|
|
getParkOptionHour(res.data.list?.hour_list); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch((err) => console.error(err)); |
|
|
|