mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-18 03:06:16 +01:00
chart tooltip sorting
This commit is contained in:
@@ -118,11 +118,21 @@ const ChartTooltipContent = React.forwardRef<
|
||||
nameKey,
|
||||
labelKey,
|
||||
unit,
|
||||
itemSorter,
|
||||
},
|
||||
ref
|
||||
) => {
|
||||
const { config } = useChart()
|
||||
|
||||
payload = React.useMemo(() => {
|
||||
if (itemSorter) {
|
||||
return payload.sort(itemSorter)
|
||||
}
|
||||
return payload
|
||||
}, [itemSorter, payload])
|
||||
|
||||
// console.log('iiiiii', itemSorter)
|
||||
|
||||
const tooltipLabel = React.useMemo(() => {
|
||||
if (hideLabel || !payload?.length) {
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user