From a5210103920fb6b19a711c1e2c62cb904f3af4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666> Date: Fri, 18 Oct 2024 09:34:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=88=A4=E6=96=AD=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E4=B8=BA0=E7=9A=84=E6=97=B6=E5=80=99=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classTask/container/classOverview/distribution/echarts.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue b/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue index 77c3522..5447495 100644 --- a/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue +++ b/src/renderer/src/views/classTask/container/classOverview/distribution/echarts.vue @@ -74,7 +74,7 @@ function initChart() { position: 'top', formatter: params => { const value = dataList.value[params.dataIndex].value; - const percentage = ((value / total) * 100).toFixed(); // 计算百分比并保留两位小数 + const percentage = value ? ((value / total) * 100).toFixed() : 0; // 计算百分比并保留两位小数 return `${value}人 ${percentage}%`; // 显示为百分比形式 }, color: '#333',