From 7aabdfc457bf7dd9a30f46b4d6efb032a196c3d8 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Wed, 25 Jul 2018 11:03:49 +0800 Subject: [PATCH] 环境管理 图表实现 --- src/app/routes/forecasting-warning/forecasting-warning.component.ts | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/app/routes/forecasting-warning/forecasting-warning.component.ts b/src/app/routes/forecasting-warning/forecasting-warning.component.ts index d9cfe0c..80daec2 100644 --- a/src/app/routes/forecasting-warning/forecasting-warning.component.ts +++ b/src/app/routes/forecasting-warning/forecasting-warning.component.ts @@ -56,6 +56,7 @@ } ] }; + public type = 'warning'; ngOnInit() { this.initWarning(); } @@ -140,6 +141,7 @@ this.option.yAxis.name = '������������'; this.option['legend'] = { right: '10%', + top: '10%', data: ['������������', '������������'] }; this.option.series[0].data = temp_day; @@ -169,7 +171,8 @@ const PM2_5 = []; const PM10 = []; const CO = []; const NO2 = []; const O3 = []; const SO2 = []; const title = '������������������'; this.option.xAxis.data = []; - this.http.get(environment.SERVER_BASH_URL + 'demo/list').subscribe((res: any) => { + const params = {size: '7'}; + this.http.get(environment.SERVER_BASH_URL + 'demo/list', {params: params}).subscribe((res: any) => { res.forEach(data => { const json = JSON.parse(data.aqi_json); PM2_5.push(json.PM2_5); -- Gitblit v1.8.0