xufenglei
2018-07-25 f8523eab69d2695163f9edb44fe822dbd0027068
src/app/routes/forecasting-warning/forecasting-warning.component.ts
@@ -99,7 +99,6 @@
        this.option.yAxis.name = '单位:℃';
        this.option.series[0].data = temp;
        this.option.series[0].itemStyle.color = this.colors[0];         forecasting_tempChart.setOption(this.option, false);
        window.onresize = forecasting_tempChart.resize;
        const forecasting_humidityChart = echarts.init(document.getElementById('forecasting_humidity'));
        this.option.title.text = title + '(湿度)';
@@ -107,7 +106,6 @@
        this.option.series[0].data = humidity;
        this.option.series[0].itemStyle.color = this.colors[1];
        forecasting_humidityChart.setOption(this.option, false);
        window.onresize = forecasting_humidityChart.resize;
        const forecasting_pressureChart = echarts.init(document.getElementById('forecasting_pressure'));
        this.option.title.text = title + '(气压)';
@@ -115,7 +113,6 @@
        this.option.series[0].data = pressure;
        this.option.series[0].itemStyle.color = this.colors[2];
        forecasting_pressureChart.setOption(this.option, false);
        window.onresize = forecasting_pressureChart.resize;
        const forecasting_uviChart = echarts.init(document.getElementById('forecasting_uvi'));
        this.option.title.text = title + '(紫外线)';
@@ -123,7 +120,6 @@
        this.option.series[0].data = uvi;
        this.option.series[0].itemStyle.color = this.colors[3];
        forecasting_uviChart.setOption(this.option, false);
        window.onresize = forecasting_uviChart.resize;
        const daydatas = daysRes['data'].forecast;
        const temp_day = [];
@@ -160,7 +156,14 @@
          }
        };
        forecasting_temp_dayChart.setOption(this.option, false);
        window.onresize = forecasting_temp_dayChart.resize;
        window.addEventListener('resize', function() {
          forecasting_tempChart.resize();
          forecasting_humidityChart.resize();
          forecasting_pressureChart.resize();
          forecasting_uviChart.resize();
          forecasting_temp_dayChart.resize();
        });
      });
  }
@@ -189,7 +192,6 @@
      this.option.series[0].data = PM2_5;
      this.option.series[0].itemStyle.color = this.colors[0];
      warning_PM25Chart.setOption(this.option, false);
      window.onresize = warning_PM25Chart.resize;
      const warning_PM10Chart = echarts.init(document.getElementById('warning_PM10'));
      this.option.title.text = title + '(PM10)';
@@ -197,7 +199,6 @@
      this.option.series[0].data = PM10;
      this.option.series[0].itemStyle.color = this.colors[1];
      warning_PM10Chart.setOption(this.option, false);
      window.onresize = warning_PM10Chart.resize;
      const warning_COChart = echarts.init(document.getElementById('warning_CO'));
      this.option.title.text = title + '(CO)';
@@ -205,7 +206,6 @@
      this.option.series[0].data = CO;
      this.option.series[0].itemStyle.color = this.colors[2];
      warning_COChart.setOption(this.option, false);
      window.onresize = warning_COChart.resize;
      const warning_NO2Chart = echarts.init(document.getElementById('warning_NO2'));
      this.option.title.text = title + '(NO2)';
@@ -213,7 +213,6 @@
      this.option.series[0].data = NO2;
      this.option.series[0].itemStyle.color = this.colors[3];
      warning_NO2Chart.setOption(this.option, false);
      window.onresize = warning_NO2Chart.resize;
      const warning_O3Chart = echarts.init(document.getElementById('warning_O3'));
      this.option.title.text = title + '(O3)';
@@ -221,7 +220,6 @@
      this.option.series[0].data = O3;
      this.option.series[0].itemStyle.color = this.colors[4];
      warning_O3Chart.setOption(this.option, false);
      window.onresize = warning_O3Chart.resize;
      const warning_SO2Chart = echarts.init(document.getElementById('warning_SO2'));
      this.option.title.text = title + '(SO2)';
@@ -229,7 +227,15 @@
      this.option.series[0].data = SO2;
      this.option.series[0].itemStyle.color = this.colors[6];
      warning_SO2Chart.setOption(this.option, false);
      window.onresize = warning_SO2Chart.resize;
      window.addEventListener('resize', function() {
        warning_PM25Chart.resize();
        warning_PM10Chart.resize();
        warning_COChart.resize();
        warning_NO2Chart.resize();
        warning_O3Chart.resize();
        warning_SO2Chart.resize();
      });
    });
  }
}