From 4d7946759c2afc163745a109492633f5b3c22ada Mon Sep 17 00:00:00 2001 From: Cxx0822 <1556464090@qq.com> Date: Mon, 17 Nov 2025 09:39:40 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E4=BD=93=E9=87=8D?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E8=87=AA=E9=80=82=E5=BA=94=E5=9D=90=E6=A0=87?= =?UTF-8?q?=E8=BD=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Health/HealthChart.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Health/HealthChart.vue b/src/components/Health/HealthChart.vue index c6ca4a2..2b06183 100644 --- a/src/components/Health/HealthChart.vue +++ b/src/components/Health/HealthChart.vue @@ -59,11 +59,12 @@ const updateChart = () => { // 体重趋势统计图 const weightXAxis = healthStore.healthRecordList.map((item) => item.date).reverse() const weightYAxis = healthStore.healthRecordList.map((item) => item.weight).reverse() + const sortedRecordList = healthStore.healthRecordList.sort((a, b) => a.weight - b.weight) weightDailyChart.setOption(lineChartOptions('日期', weightXAxis, '体重(千克)', weightYAxis)) weightDailyChart.setOption({ yAxis: { - min: 60, - max: 90 + min: Math.floor(sortedRecordList[0].weight), + max: Math.ceil(sortedRecordList[sortedRecordList.length - 1].weight) } })