折线图

This commit is contained in:
Hobart 2023-02-22 16:47:04 +08:00
parent a0e97c56ee
commit 1d018c9bfd
1 changed files with 7 additions and 12 deletions

View File

@ -152,8 +152,7 @@ export default {
watch: {
list: {
handler(newVal) {
if (newVal.length!=0) {
if (newVal.length != 0) {
// x
this.xData = newVal.map(val => {
return val.time;
@ -182,7 +181,7 @@ export default {
confine: true
};
this.series[0].name = '总量';
console.log("折线图",newVal)
console.log('折线图', newVal);
//
let arr = newVal.map(function(ele) {
if (ele.type_data != null) {
@ -197,10 +196,8 @@ export default {
}
var lineArr = [];
// 线
if (this.typeValue) {
console.log("this.typeValue.type_data",this.typeValue.type_data)
if (this.typeValue.type_data!=undefined) {
this.typeValue.type_data.forEach(ele => {
if (newVal[0].type_data != undefined) {
newVal[0].type_data.forEach(ele => {
lineArr.push({
name: ele.name,
type: 'line',
@ -208,9 +205,7 @@ export default {
smooth: true
});
});
}
}
//
mapN.forEach(ele => {
if (ele.name == '机动车') {
@ -256,7 +251,7 @@ export default {
return ele.in_flow + ele.out_flow;
});
} else if (this.title == '车头时距') {
console.log("车头时距",newVal)
console.log('车头时距', newVal);
this.tooltip = {
formatter: '{a} {b}:{c}/s',
show: true,
@ -275,7 +270,7 @@ export default {
});
} else if (this.title == '延误') {
this.series[0].data = newVal.map(val => {
return val.ave_delay;
return val.ave_delay;
});
} else if (this.title == '拥堵') {
this.series[0].data = newVal.map(val => {});
@ -288,7 +283,7 @@ export default {
}
},
immediate: true
},
}
}
};
</script>