diff --git a/src/components/Dashboard.tsx b/src/components/Dashboard.tsx index 5fd1794..303d58a 100644 --- a/src/components/Dashboard.tsx +++ b/src/components/Dashboard.tsx @@ -55,6 +55,7 @@ export default function Dashboard() { const { incomeTotal, expenseTotal } = calcMonthlyPL(accounts, transactions, y, mo); return { month: showYear ? `'${String(y).slice(2)}/${mo}月` : `${mo}月`, + monthKey: m, 収入: incomeTotal, 支出: expenseTotal, }; @@ -143,15 +144,33 @@ export default function Dashboard() {

月別収支

- + { + if (data?.activePayload?.[0]?.payload?.monthKey) { + setSelectedMonth(data.activePayload[0].payload.monthKey); + setDrillAccountId(null); + } + }} + > `${(v / 10000).toFixed(0)}万`} tick={{ fontSize: 11, fill: '#94a3b8' }} /> formatAmount(v)} contentStyle={CHART_TOOLTIP_STYLE} /> - - + + {monthlyData.map((entry, i) => ( + + ))} + + + {monthlyData.map((entry, i) => ( + + ))} +