Add switch for small histograms

- adapts distance of labels to x axis
This commit is contained in:
Christoph Kluge
2023-06-09 13:30:55 +02:00
parent edb1b47281
commit 6e5afd1192
2 changed files with 3 additions and 2 deletions

View File

@@ -160,7 +160,7 @@
{#key $statsQuery.data.topUsers}
<h4>Top Users (by node hours)</h4>
<Histogram
width={colWidth - 25} height={300 * 0.5}
width={colWidth - 25} height={300 * 0.5} small={true}
data={$statsQuery.data.topUsers.sort((a, b) => b.count - a.count).map(({ count }, idx) => ({ count, value: idx }))}
label={(x) => x < $statsQuery.data.topUsers.length ? $statsQuery.data.topUsers[Math.floor(x)].name : 'No Users'}
ylabel="Node Hours [h]"/>