Skip to content

Commit

Permalink
fix text a little
Browse files Browse the repository at this point in the history
  • Loading branch information
quinn committed Feb 4, 2024
1 parent 054eef6 commit f052882
Showing 1 changed file with 36 additions and 18 deletions.
54 changes: 36 additions & 18 deletions src/components/graph/NetWorthChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,42 @@ export function NetWorthChart({ filteredData, date, setDate }: Props) {
}
/>
{d.data.map((d) => (
<text
key={d.name}
// fill="currentColor"
x={x(new Date(d.date)) ?? 0}
y={y(d.amount) ?? 0}
// dy={15}
textAnchor="middle"
fontSize="12"
transform="translate(15,0)"
fill={
hoveredTick === d.date || date === d.date
? 'purple'
: 'transparent'
}
>
{d.name}
{formatMoneyK(d.amount)}
</text>
<g>
<text
key={d.name}
// fill="currentColor"
x={x(new Date(d.date)) ?? 0}
y={y(d.amount) ?? 0}
// dy={15}
textAnchor="middle"
fontSize="12"
transform="translate(15,0)"
fill={
hoveredTick === d.date || date === d.date
? 'purple'
: 'transparent'
}
>
{d.name}
</text>
<text
key={d.name}
// fill="currentColor"
x={x(new Date(d.date)) ?? 0}
y={(y(d.amount) ?? 0) + 10}
// dy={15}
textAnchor="middle"
fontSize="12"
transform="translate(15,0)"
fill={
hoveredTick === d.date || date === d.date
? 'purple'
: 'transparent'
}
>
{formatMoneyK(d.amount)}
</text>
</g>
))}
</Fragment>
))}
Expand Down

0 comments on commit f052882

Please sign in to comment.