feat:更新运动健康模块

This commit is contained in:
2026-03-15 23:14:35 +08:00
parent 1fb76fc220
commit 11887bf3d5
3 changed files with 52 additions and 21 deletions

View File

@@ -78,12 +78,15 @@ const updateChart = () => {
const sortedRecordList = weightRecordList.sort((a, b) => a.weight - b.weight)
weightDailyChart.setOption(lineChartOptions('日期', weightXAxis, '体重(千克)', weightYAxis))
weightDailyChart.setOption({
yAxis: {
min: Math.floor(sortedRecordList[0].weight),
max: Math.ceil(sortedRecordList[sortedRecordList.length - 1].weight)
}
})
if (sortedRecordList.length > 0) {
weightDailyChart.setOption({
yAxis: {
min: Math.floor(sortedRecordList[0].weight),
max: Math.ceil(sortedRecordList[sortedRecordList.length - 1].weight)
}
})
}
// 睡眠时长统计图
const sleepRecordList = healthStore.healthRecordList