diff --git a/AppImage/components/metrics-dialog.tsx b/AppImage/components/metrics-dialog.tsx index 72b1ba7..10787ff 100644 --- a/AppImage/components/metrics-dialog.tsx +++ b/AppImage/components/metrics-dialog.tsx @@ -167,7 +167,7 @@ export function MetricsView({ vmid, vmName, vmType, metricType, onBack }: Metric case "cpu": return ( - + Math.ceil(dataMax * 1.2)]} + domain={[ + 0, + (dataMax: number) => { + const percentMargin = Math.ceil(dataMax * 1.1) + const fixedMargin = dataMax + 5 + return Math.max(percentMargin, fixedMargin, 10) + }, + ]} allowDataOverflow={false} /> - + Math.ceil(dataMax * 1.2)]} + domain={[ + 0, + (dataMax: number) => { + const percentMargin = Math.ceil(dataMax * 1.1) + const fixedMargin = dataMax + 5 + return Math.max(percentMargin, fixedMargin, 10) + }, + ]} allowDataOverflow={false} /> - + Math.ceil(dataMax * 1.2)]} + domain={[ + 0, + (dataMax: number) => { + const percentMargin = Math.ceil(dataMax * 1.1) + const fixedMargin = dataMax + 5 + return Math.max(percentMargin, fixedMargin, 10) + }, + ]} allowDataOverflow={false} /> - + Math.ceil(dataMax * 1.2)]} + domain={[ + 0, + (dataMax: number) => { + const percentMargin = Math.ceil(dataMax * 1.1) + const fixedMargin = dataMax + 5 + return Math.max(percentMargin, fixedMargin, 10) + }, + ]} allowDataOverflow={false} />