From 8351f9e72d58f81f36b3b7ea528571714d0040e8 Mon Sep 17 00:00:00 2001 From: weiwei Date: Wed, 13 Aug 2025 20:08:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/tabbar/canteenAnalyse.vue | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/pages/tabbar/canteenAnalyse.vue b/src/pages/tabbar/canteenAnalyse.vue index eceaae7..d5caf57 100644 --- a/src/pages/tabbar/canteenAnalyse.vue +++ b/src/pages/tabbar/canteenAnalyse.vue @@ -8,7 +8,7 @@ - 近一周食堂购买次数趋势图 + 近一周食堂购买人数趋势图 @@ -90,6 +90,14 @@ const pieChartOpts = { color: COLORLIST, padding: [15, 15, 15, 15], enableScroll: false, + legend: { + float: "center", + padding: 2, + margin: 2, + fontSize: 14, + lineHeight: 14, + itemGap: 10, + }, extra: { pie: { activeOpacity: 0.5, @@ -108,7 +116,14 @@ const areaChartOpts = { color: COLORLIST, padding: [15, 0, 0, -5], enableScroll: false, - legend: {}, + legend: { + float: "center", + padding: 2, + margin: 2, + fontSize: 12, + lineHeight: 12, + itemGap: 4, + }, xAxis: { disableGrid: true, }, @@ -119,6 +134,8 @@ const areaChartOpts = { data: [ { title: "购买人数", + titleOffsetX: 10, + titleOffsetY: -4, }, ], }, @@ -156,7 +173,7 @@ const getPieChartData = async () => { index: index, name: item.classifyName, value: Number(item.payUserCount), - labelText: item.classifyName, + labelText: `${item.classifyName} ${item.payUserCount}次`, ...item, } })