diff --git a/beszel/site/src/components/charts/container-chart.tsx b/beszel/site/src/components/charts/container-chart.tsx index 0a621f6..32727da 100644 --- a/beszel/site/src/components/charts/container-chart.tsx +++ b/beszel/site/src/components/charts/container-chart.tsx @@ -157,6 +157,7 @@ export default memo(function ContainerChart({ formatShortDate(data[0].payload.created)} // @ts-ignore itemSorter={(a, b) => b.value - a.value} diff --git a/beszel/site/src/components/ui/chart.tsx b/beszel/site/src/components/ui/chart.tsx index 091f699..83e105a 100644 --- a/beszel/site/src/components/ui/chart.tsx +++ b/beszel/site/src/components/ui/chart.tsx @@ -99,6 +99,7 @@ const ChartTooltipContent = React.forwardRef< unit?: string filter?: string contentFormatter?: (item: any, key: string) => React.ReactNode | string + truncate?: boolean } >( ( @@ -119,6 +120,7 @@ const ChartTooltipContent = React.forwardRef< filter, itemSorter, contentFormatter: content = undefined, + truncate = false, }, ref ) => { @@ -214,10 +216,15 @@ const ChartTooltipContent = React.forwardRef< nestLabel ? "items-end" : "items-center" )} > -
- {nestLabel ? tooltipLabel : null} - {itemConfig?.label || item.name} -
+ {nestLabel ? tooltipLabel : null} + + {itemConfig?.label || item.name} + {item.value !== undefined && ( {content && typeof content === "function"