Skip to content

Lightweight server monitoring with historical data, docker stats, and alerts.

fix(ui): evenly space swap chart axis ticks (#2708)

Sven van Ginkelb3a2fe919905
diff --git a/internal/site/src/components/routes/system/charts/memory-charts.tsx b/internal/site/src/components/routes/system/charts/memory-charts.tsx
index 671a4cf48..6c2a05965 100644
--- a/internal/site/src/components/routes/system/charts/memory-charts.tsx
+++ b/internal/site/src/components/routes/system/charts/memory-charts.tsx
@@ -156,17 +156,12 @@ export function SwapChart({
if (!hasSwapData) {
return null
}
+ const totalSwap = lastStats?.swap?.[0] ?? gbToBytes(lastStats?.s) ?? 0
return (
<ChartCard empty={dataEmpty} grid={grid} title={t`Swap Usage`} description={t`Swap space used by the system`}>
<AreaChartDefault
chartData={chartData}
- domain={[
- 0,
- () => {
- const stats = chartData.systemStats.at(-1)?.stats
- return stats?.swap?.[0] ?? gbToBytes(stats?.s) ?? 0
- },
- ]}
+ domain={[0, totalSwap]}
contentFormatter={contentFormatter}
tickFormatter={tickFormatter}
dataPoints={[