From f96648e162c8a79077d52b06c60ba6f6c318f53e Mon Sep 17 00:00:00 2001 From: Felix Schulze Date: Thu, 1 May 2025 20:12:30 +0200 Subject: [PATCH] fix allowance y-axis and chart styling --- src/app/components/FireCalculatorForm.tsx | 67 +++++++++++------------ 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/src/app/components/FireCalculatorForm.tsx b/src/app/components/FireCalculatorForm.tsx index 41297c5..e183f6c 100644 --- a/src/app/components/FireCalculatorForm.tsx +++ b/src/app/components/FireCalculatorForm.tsx @@ -383,8 +383,8 @@ export default function FireCalculatorForm() { { field.onChange(...value); @@ -412,23 +412,14 @@ export default function FireCalculatorForm() { Projected balance growth with your selected retirement age - + + {/* Left Y axis */} { if (value >= 1000000) { return `${(value / 1000000).toPrecision(3)}M`; @@ -452,7 +446,21 @@ export default function FireCalculatorForm() { } return value.toString(); }} - width={25} + width={30} + /> + {/* Right Y axis */} + { + if (value >= 1000000) { + return `${(value / 1000000).toPrecision(3)}M`; + } else if (value >= 1000) { + return `${(value / 1000).toPrecision(3)}K`; + } + return value.toString(); + }} + width={30} /> @@ -474,24 +482,6 @@ export default function FireCalculatorForm() { stopOpacity={0.1} /> - - - - {result.fireNumber && ( )}