From a8e91e9bc8d6900ce99c3c74feb283b5ca63885b Mon Sep 17 00:00:00 2001 From: Darren Yu Date: Tue, 16 Sep 2025 10:24:52 +0800 Subject: [PATCH] fix(dashboard): y-axis truncated incorrectly in certain value (#313) * fix(dashboard): y-axis truncated incorrectly in certain value * Update Home.tsx --- src/component/Admin/Home/Home.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/Admin/Home/Home.tsx b/src/component/Admin/Home/Home.tsx index 3be871c..f9ae8cc 100644 --- a/src/component/Admin/Home/Home.tsx +++ b/src/component/Admin/Home/Home.tsx @@ -150,8 +150,8 @@ const Home = () => { ...(summary?.metrics_summary?.files ?? []), ...(summary?.metrics_summary?.shares ?? []), ]; - const yAxisUpperLimit = yAxisValue.length ? Math.max(...yAxisValue) : 0; - const yAxisDigits = yAxisUpperLimit > 0 ? Math.floor(Math.log10(yAxisUpperLimit)) + 1 : 1; + const yAxisUpperLimit = yAxisValue.length ? Math.max(...yAxisValue) / 0.8 - 1 : 0; + const yAxisDigits = yAxisUpperLimit > 1 ? Math.floor(Math.log10(yAxisUpperLimit)) + 1 : 1; return 3 + yAxisDigits * 9; })()} />