|
@@ -16,13 +16,16 @@ import * as echarts from 'echarts';
|
|
|
props: ["resData"],
|
|
|
data() {
|
|
|
return {
|
|
|
- data:[]
|
|
|
+ data:[],
|
|
|
+ time:null
|
|
|
};
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
resData(val,old){
|
|
|
- this.data = val
|
|
|
+ var myDate = new Date();
|
|
|
+ this.time = new Date().getHours() + 1
|
|
|
+ this.data = JSON.parse(JSON.stringify(val))
|
|
|
this.getData()
|
|
|
}
|
|
|
},
|
|
@@ -47,7 +50,7 @@ import * as echarts from 'echarts';
|
|
|
xAxis: {
|
|
|
type: 'category',
|
|
|
boundaryGap: false,
|
|
|
- data: this.data[0],
|
|
|
+ data: this.data[0].splice(0,this.time),
|
|
|
axisTick: {
|
|
|
alignWithLabel: true
|
|
|
},
|
|
@@ -99,7 +102,7 @@ import * as echarts from 'echarts';
|
|
|
smooth: true,
|
|
|
symbol:'circle',
|
|
|
symbolSize:[6,6],
|
|
|
- data: this.data[1]
|
|
|
+ data: this.data[1].splice(0,this.time)
|
|
|
},
|
|
|
{
|
|
|
name: this.data[3][1],
|
|
@@ -108,7 +111,7 @@ import * as echarts from 'echarts';
|
|
|
smooth: true,
|
|
|
symbol:'circle',
|
|
|
symbolSize:[6,6],
|
|
|
- data: this.data[2]
|
|
|
+ data: this.data[2].splice(0,this.time)
|
|
|
}
|
|
|
]
|
|
|
};
|