Show user names in the user stats chart, top spender first

This commit is contained in:
ponas committed 2026-10-23 02:19:40 +02:00
1 parent 336f6afa5d
commit 3ade11111b
1 file changed
+4 -2
+4 -2
View File
@@ -19,7 +19,9 @@ const UserStats = () => {
total: Number(user.profile?.orderSumTotal || 0), total: Number(user.profile?.orderSumTotal || 0),
})) }))
.sort((a, b) => b.total - a.total) .sort((a, b) => b.total - a.total)
.slice(0, 10); .slice(0, 10)
// nivo draws the first item of a horizontal chart at the bottom
.reverse();
return ( return (
<StatsView loading={loading}> <StatsView loading={loading}>
@@ -40,7 +42,7 @@ const UserStats = () => {
legendPosition: "middle", legendPosition: "middle",
legendOffset: 32, legendOffset: 32,
}} }}
axisLeft={null} axisLeft={{ tickSize: 0, tickPadding: 8 }}
valueFormat={(value) => `${Number(value).toLocaleString("no")} kr`} valueFormat={(value) => `${Number(value).toLocaleString("no")} kr`}
/> />
</div> </div>