extra fs charts and filter bar for container charts

This commit is contained in:
Henry Dollman
2024-09-02 16:13:07 -04:00
parent 1cfda8fb9f
commit ec5b1a833d
12 changed files with 543 additions and 213 deletions

View File

@@ -100,6 +100,7 @@ const ChartTooltipContent = React.forwardRef<
nameKey?: string
labelKey?: string
unit?: string
filter?: string
contentFormatter?: (item: any, key: string) => React.ReactNode | string
}
>(
@@ -119,6 +120,7 @@ const ChartTooltipContent = React.forwardRef<
nameKey,
labelKey,
unit,
filter,
itemSorter,
contentFormatter: content = undefined,
},
@@ -127,6 +129,9 @@ const ChartTooltipContent = React.forwardRef<
const { config } = useChart()
React.useMemo(() => {
if (filter) {
payload = payload?.filter((item) => (item.name as string)?.includes(filter))
}
if (itemSorter) {
// @ts-ignore
payload?.sort(itemSorter)