From c597ff5895ae803ce5584f3e8463d8f9224b0fa4 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Fri, 27 Apr 2018 09:03:59 +0800 Subject: [PATCH] 优化 饼图功能 --- src/app/routes/reports/alarm/alarm.component.ts | 16 +++++++++------- src/app/routes/report/report.component.css | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/routes/report/report.component.css b/src/app/routes/report/report.component.css index 4c1ce15..7b53889 100644 --- a/src/app/routes/report/report.component.css +++ b/src/app/routes/report/report.component.css @@ -44,7 +44,7 @@ .table_bg{ margin: 0 85px;} .table_t{} - .table_t .t01,.table_t .t02,.table_t .t03,.table_t .t04{ float: right;text-align:center;font-size: 12px;color: #00f6ff; font-weight: bold;} + .table_t .t01,.table_t .t02,.table_t .t03,.table_t .t04{ float: right;text-align:center;font-size: 12px;color: #041324; font-weight: bold;} .table_t .t01{ width: 125px;} .table_t .t02{ width: 115px;} .table_t .t03{ width: 260px;} diff --git a/src/app/routes/reports/alarm/alarm.component.ts b/src/app/routes/reports/alarm/alarm.component.ts index 0a7a2b1..fcc2fa1 100644 --- a/src/app/routes/reports/alarm/alarm.component.ts +++ b/src/app/routes/reports/alarm/alarm.component.ts @@ -273,14 +273,16 @@ index = index + 1; } } else { - option.title.text = '������������������������'; option.series = []; - this.serie.data = res.data.list; - option.series.push(this.serie); - const myChart = echarts.init(document.getElementById('mydiv' + index)); - myChart.setOption(option, true); - window.onresize = myChart.resize; - index = index + 1; + if (!!res.data.list && res.data.list.length > 0) { + option.title.text = '������������������������'; + this.serie.data = res.data.list; + option.series.push(this.serie); + const myChart = echarts.init(document.getElementById('mydiv' + index)); + myChart.setOption(option, true); + window.onresize = myChart.resize; + index = index + 1; + } // this.setOption(option,index); } -- Gitblit v1.8.0