From d31e2b98a7fc6f1a629e43fd6c7c4bf84b0514cc Mon Sep 17 00:00:00 2001 From: suyanyan <1321717064@qq.com> Date: Sun, 29 Sep 2024 11:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=85=E9=81=93bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/violation/portraitSummary/index.vue | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue b/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue index 9362e35..9f49b24 100644 --- a/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue +++ b/SafeCampus.WEB/src/views/violation/portraitSummary/index.vue @@ -65,7 +65,11 @@ const getDataChart = async () => { getCharts1(sex.data.label, sex.data.value); /* 获取学生年龄 */ let age: any = await portraitSummaryApi.getStudentAge(); - getCharts2(age.data.label, age.data.value); + let data = { + label: [89, 99, 36, 29, 31, 30, 28, 22, 32, 33, 35, 12012012, 26, 27, 23], + value: [1, 1, 1, 2, 2, 2, 1, 16, 1, 1, 1, 1, 1, 1, 1] + }; + getCharts2(data.label, data.value); /* 获取属性标签 */ let attr: any = await portraitSummaryApi.getStudentAttr(); getCharts4(attr.data.label, attr.data.value); @@ -104,7 +108,7 @@ function getCharts1(label: any, value: any) { type: "pie", radius: "80%", center: ["50%", "50%"], - roseType: "area", + // roseType: "area", label: { normal: { show: true @@ -158,10 +162,15 @@ function getCharts2(label: any, value: any) { { name: "年龄分布", type: "pie", - radius: [50, 140], - + radius: [50, 110], roseType: "area", + center: ["35%", "50%"], data: data, + label: { + bleedMargin: 5, + position: "outer", + alignTo: "none" + }, itemStyle: { normal: { label: { @@ -171,7 +180,12 @@ function getCharts2(label: any, value: any) { } }, labelLine: { - show: true + show: true, //数据标签引导线 + length: 20, + lineStyle: { + width: 1, + type: "solid" + } } } }