revert to previous behavior for displaying stopped containers

* Previously, a stopped container was completely removed from the chart/tooltip during the time period when it was not running. In the last few releases, the container remained in the chart with zero values if it was running at any time during the chart's duration. This restores the previous functionality.
This commit is contained in:
Henry Dollman
2024-11-04 21:24:44 -05:00
parent 640ee7a88e
commit 98c4102f72

View File

@@ -116,9 +116,9 @@ export default memo(function ContainerChart({
}
// data function
if (isNetChart) {
obj.dataFunction = (key: string, data: any) => (data[key]?.nr ?? 0) + (data[key]?.ns ?? 0)
obj.dataFunction = (key: string, data: any) => (data[key]?.nr ?? null) + (data[key]?.ns ?? null)
} else {
obj.dataFunction = (key: string, data: any) => data[key]?.[dataKey] ?? 0
obj.dataFunction = (key: string, data: any) => data[key]?.[dataKey] ?? null
}
return obj
}, [])