Skip to content

Commit

Permalink
Updating logic to cost
Browse files Browse the repository at this point in the history
  • Loading branch information
evmiguel committed Apr 9, 2024
1 parent 542b399 commit 6092864
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/Analysis/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -100,7 +100,7 @@ export default function Analysis({ purchases }: AnalysisProps) {
alignmentBaseline="central"
fontSize={12}
>
{d.name.replace(' ', '\n')}
{d.name}
</text>
</g>
);
Expand Down

0 comments on commit 6092864

Please sign in to comment.