From 8bcf063838a285bdcd88429f7eee732508bb42bf Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Wed, 5 Aug 2026 10:04:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=E4=BF=AE=E5=A4=8D=20Chart.js=20?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E5=9B=BE=E6=97=A0=E9=99=90=E5=8F=98=E9=AB=98?= =?UTF-8?q?=EF=BC=88=E5=93=8D=E5=BA=94=E5=BC=8F=E5=B0=BA=E5=AF=B8=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E5=BE=AA=E7=8E=AF=EF=BC=89=20=20-=20canvas=20?= =?UTF-8?q?=E5=A4=96=E5=8C=85=E5=9B=BA=E5=AE=9A=E9=AB=98=E5=BA=A6=20.chart?= =?UTF-8?q?-box=EF=BC=8Ccanvas=20=E7=BB=9D=E5=AF=B9=E5=AE=9A=E4=BD=8D=20in?= =?UTF-8?q?set:0=20-=20=E5=AE=B9=E5=99=A8=E9=AB=98=E5=BA=A6=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=8F=97=20canvas=20=E5=86=85=E8=81=94=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E5=BD=B1=E5=93=8D=EF=BC=8Cresize=20=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E7=BB=88=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/app.js | 2 +- app/static/style.css | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/static/app.js b/app/static/app.js index ba605d0..f5dcd99 100644 --- a/app/static/app.js +++ b/app/static/app.js @@ -234,7 +234,7 @@ ${hist.length > 0 ? `
余额历史 · ${WINDOW_LABELS[win]}(${hist.length} 条${th !== null ? `,虚线阈值 ${th}` : ""})
- +
${winBtns}
` : ""} diff --git a/app/static/style.css b/app/static/style.css index e8c4d8d..c76d2f3 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -597,12 +597,19 @@ label { font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: width: 100%; height: 30px; } -/* 卡片迷你图(Chart.js canvas) */ -.card-chart { - display: block; - width: 100%; +/* 卡片迷你图(Chart.js canvas)——chart-box 固定高度,canvas 绝对定位, + 避免 Chart.js responsive 尺寸与容器高度互相反馈导致无限变高 */ +.chart-box { + position: relative; height: 36px; } +.card-chart { + position: absolute; + inset: 0; + width: 100% !important; + height: 100% !important; + display: block; +} .spark-title { font-size: 10px; color: var(--text-3);