|
@@ -263,18 +263,18 @@
|
|
|
}
|
|
|
this.option.series.push(boxForm);
|
|
|
this.option.legend.data.push(boxForm.name);
|
|
|
- console.log(this.option.series, 'this.option.series');
|
|
|
}
|
|
|
+ console.log(this.option.series, 'this.option.series');
|
|
|
}
|
|
|
// 如果车辆温度数组为空,则其它数组前移一位
|
|
|
- for (;;) {
|
|
|
+ for (let i = 1;;) {
|
|
|
if (this.option.series[0].data.length == 0) {
|
|
|
- for (let i = 0; i < this.option.series.length - 1; i++) {
|
|
|
- this.option.series[i] = this.option.series[i + 1];
|
|
|
- this.option.legend.data[i] = this.option.legend.data[i + 1];
|
|
|
+ for (let j = 0; j < this.option.series.length - i; j++) {
|
|
|
+ this.option.series[j] = this.option.series[j + 1];
|
|
|
+ this.option.legend.data[j] = this.option.legend.data[j + 1];
|
|
|
}
|
|
|
- this.option.series[this.option.series.length - 1] = '';
|
|
|
- this.option.legend.data[this.option.series.length - 1] = '';
|
|
|
+ this.option.series[this.option.series.length - i] = '';
|
|
|
+ this.option.legend.data[this.option.series.length - i++] = '';
|
|
|
}
|
|
|
if (this.option.series[0].data.length != 0) {
|
|
|
break;
|