From 60928645c21be8de6cdbb39b88e800008a465e81 Mon Sep 17 00:00:00 2001 From: Erika Miguel Date: Tue, 9 Apr 2024 16:23:09 -0400 Subject: [PATCH] Updating logic to cost --- components/Analysis/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Analysis/index.tsx b/components/Analysis/index.tsx index ed6b9d7..bb0586c 100644 --- a/components/Analysis/index.tsx +++ b/components/Analysis/index.tsx @@ -45,7 +45,7 @@ export default function Analysis({ purchases }: AnalysisProps) { const itemsBought = sumByKey(filteredPurchases, 'name', 'cost').sort((a, b) => b.cost - a.cost); const categoriesChartData = sumByKey(filteredPurchases.map(purchase => { - return { name: purchase.category, value: 1} + return { name: purchase.category, value: purchase.cost} }), 'name', 'value'); // bounds = area inside the graph axis = calculated by substracting the margins @@ -100,7 +100,7 @@ export default function Analysis({ purchases }: AnalysisProps) { alignmentBaseline="central" fontSize={12} > - {d.name.replace(' ', '\n')} + {d.name} );