From a266a2d6bcbc1bd0e3fdff2231353a2a325399c2 Mon Sep 17 00:00:00 2001 From: liuye Date: Wed, 7 Sep 2022 10:38:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppResidentStatistics.vue | 2 +- .../components/Files.vue | 93 +++++++++++++++---- .../components/Message.vue | 91 +++++++++++++++++- 3 files changed, 164 insertions(+), 22 deletions(-) diff --git a/src/project/saas/AppResidentStatistics/AppResidentStatistics.vue b/src/project/saas/AppResidentStatistics/AppResidentStatistics.vue index 97fd4425..4a18ed55 100644 --- a/src/project/saas/AppResidentStatistics/AppResidentStatistics.vue +++ b/src/project/saas/AppResidentStatistics/AppResidentStatistics.vue @@ -40,7 +40,7 @@ export default { component: Message }, ], - tabIndex: 0, + tabIndex: 2, areaId: '', areaName: '', } diff --git a/src/project/saas/AppResidentStatistics/components/Files.vue b/src/project/saas/AppResidentStatistics/components/Files.vue index 00cea72c..ac1f1f50 100644 --- a/src/project/saas/AppResidentStatistics/components/Files.vue +++ b/src/project/saas/AppResidentStatistics/components/Files.vue @@ -33,58 +33,113 @@ export default { }, series: [ { - name: 'Access From', + name: '特殊人群', type: 'pie', - radius: ['40%', '70%'], + radius: ['30%', '60%'], + itemStyle: { + normal: { + color: function (colors) { + var colorList = ['#83B5F7', '#7E94F6', '#85E3D5', '#2891FF']; + return colorList[colors.dataIndex]; + } + }, + }, data: [ - { value: 1048, name: 'Search Engine' }, - { value: 735, name: 'Direct' }, - { value: 580, name: 'Email' }, - { value: 484, name: 'Union Ads' }, - { value: 300, name: 'Video Ads' } + { value: 100, name: '吸毒人员100' }, + { value: 150, name: '高龄老人150' }, + { value: 80, name: '刑满释放人员80' }, + { value: 84, name: '退伍军人84' }, ], emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' + shadowColor: 'rgba(0, 0, 0, 0.5)', } } } ] }; this.echartDataSpecial.setOption(option) - this.echartDataSex.setOption(option) var option2 = { + grid: { + top: '10%', + left: '4%', + right: '4%', + bottom: '10%', + containLabel: true + }, xAxis: { type: 'category', - data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] + data: ['10岁以下', '10-18岁', '18-65岁', '65-80岁', '80岁以上'] }, yAxis: { type: 'value' }, series: [ { + itemStyle: { + normal: { + color: ['#0072FF'], + label: { + show: true, //开启显示数值 + position: 'top', //数值在上方显示 + textStyle: { //数值样式 + color: '#919191', //字体颜色 + fontSize: 14 //字体大小 + } + } + } + }, data: [ - 120, + 136, 195, 162, 138, { - value: 200, + value: 98, itemStyle: { - color: '#a90000' + color: '#F09535' } }, - 150, - 80, - 70, - 110, - 130 ], - type: 'bar' + type: 'bar', + barWidth : 20, } ] }; this.echartDataAge.setOption(option2) + + var option3 = { + tooltip: { + trigger: 'item' + }, + series: [ + { + name: '男女比例', + type: 'pie', + radius: ['40%', '70%'], + itemStyle: { + normal: { + color: function (colors) { + var colorList = ['#2891FF', '#FF8700']; + return colorList[colors.dataIndex]; + } + }, + }, + data: [ + { value: 100, name: '男100' }, + { value: 100, name: '女100' }, + ], + emphasis: { + itemStyle: { + shadowBlur: 10, + shadowOffsetX: 0, + shadowColor: 'rgba(0, 0, 0, 0.5)', + } + } + } + ] + }; + this.echartDataSex.setOption(option3) }, }, created() { diff --git a/src/project/saas/AppResidentStatistics/components/Message.vue b/src/project/saas/AppResidentStatistics/components/Message.vue index c0ff99ec..560ff260 100644 --- a/src/project/saas/AppResidentStatistics/components/Message.vue +++ b/src/project/saas/AppResidentStatistics/components/Message.vue @@ -1,6 +1,12 @@