From 15c2cce263122c8d38e929a370499d5f75fa83fb Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Tue, 7 Apr 2026 11:59:01 +0530 Subject: [PATCH] comparison amount text height refactor to avoid amount text clipping comparison bar --- src/components/HistoryChart.tsx | 44 +++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/components/HistoryChart.tsx b/src/components/HistoryChart.tsx index 4bb4061..47b2800 100644 --- a/src/components/HistoryChart.tsx +++ b/src/components/HistoryChart.tsx @@ -162,7 +162,10 @@ export default function HistoryChart({ {currentData.map((point) => { const currentHeight = (point.amount / maxAmount) * 100; - const compareHeight = ((point.compareAmount || 0) / maxAmount) * 100; + const compareHeight = comparison + ? ((point.compareAmount || 0) / maxAmount) * 100 + : 0; + const labelHeight = Math.max(currentHeight, compareHeight); return ( + + {formatDisplay(point, activeTab.toLowerCase(), comparison)} + + + {/* Compare */} {comparison && ( )} + {/* Spacer */} + + + {/* Current */} - - {formatDisplay(point, activeTab.toLowerCase(), comparison)} - - + />