From 95503291b69ca4a7e9fb5891d952d0a30ea5ce07 Mon Sep 17 00:00:00 2001 From: "xinxin.wu" Date: Wed, 11 Dec 2024 18:53:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B7=A5=E4=BD=9C=E5=8F=B0):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=B7=A5=E4=BD=9C=E5=8F=B0=E6=B5=8B=E8=AF=95=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E6=A6=82=E8=A7=88=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../homePage/components/ratioPie.vue | 38 ++++++++++--------- .../homePage/components/testPlanOverview.vue | 22 ++++++----- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/frontend/src/views/workbench/homePage/components/ratioPie.vue b/frontend/src/views/workbench/homePage/components/ratioPie.vue index 030591eeba..bef10ce9c7 100644 --- a/frontend/src/views/workbench/homePage/components/ratioPie.vue +++ b/frontend/src/views/workbench/homePage/components/ratioPie.vue @@ -147,6 +147,8 @@ radius: ['75%', '90%'], center: ['50%', '50%'], color: [], + minAngle: 5, + minShowLabelAngle: 10, avoidLabelOverlap: false, label: { show: false, @@ -175,22 +177,24 @@ const pieBorderWidth = hasDataLength === 1 ? 0 : 1; - options.value.series.data = - hasDataLength > 0 - ? temData.map((e) => { - return { - ...e, - tooltip: { - ...toolTipConfig, - show: !!props.hasPermission, - }, - itemStyle: { - borderWidth: pieBorderWidth, - borderColor: '#ffffff', - }, - }; - }) - : []; + const seriesData = temData + .map((e, i) => { + return { + ...e, + tooltip: { + ...toolTipConfig, + show: !!props.hasPermission, + }, + itemStyle: { + color: color[i], + borderWidth: pieBorderWidth, + borderColor: '#ffffff', + }, + }; + }) + .filter((e) => e.value !== 0); + + options.value.series.data = hasDataLength > 0 ? seriesData : []; legend.value = [...props.data.slice(1)].map((e, i) => { return { ...e, @@ -213,8 +217,6 @@ options.value.tooltip.show = !!props.hasPermission; options.value.title.text = name; - - options.value.series.color = color; } const chartRef = ref>(); diff --git a/frontend/src/views/workbench/homePage/components/testPlanOverview.vue b/frontend/src/views/workbench/homePage/components/testPlanOverview.vue index c75a2f2576..b555578148 100644 --- a/frontend/src/views/workbench/homePage/components/testPlanOverview.vue +++ b/frontend/src/views/workbench/homePage/components/testPlanOverview.vue @@ -257,16 +257,18 @@ const pieBorderWidth = executeData.filter((e) => Number(e.value) > 0).length === 1 ? 0 : 1; - execOptions.value.series.data = executeData.map((e) => { - return { - ...e, - itemStyle: { - borderWidth: pieBorderWidth, - borderColor: '#ffffff', - color: e.color, - }, - }; - }); + execOptions.value.series.data = executeData + .map((e) => { + return { + ...e, + itemStyle: { + borderWidth: pieBorderWidth, + borderColor: '#ffffff', + color: e.color, + }, + }; + }) + .filter((e) => e.value !== 0); } const showSkeleton = ref(false);