fixed incompatibility
This commit is contained in:
parent
aaa9b82219
commit
1d22dc8b25
@ -3,6 +3,7 @@
|
||||
import * as React from "react"
|
||||
import * as RechartsPrimitive from "recharts"
|
||||
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
// Format: { THEME_NAME: CSS_SELECTOR }
|
||||
@ -104,6 +105,19 @@ ${colorConfig
|
||||
|
||||
const ChartTooltip = RechartsPrimitive.Tooltip
|
||||
|
||||
type ChartTooltipContentProps = React.ComponentProps<"div"> &
|
||||
Omit<RechartsPrimitive.TooltipProps<any, any>, "content"> & {
|
||||
active?: boolean
|
||||
payload?: any[]
|
||||
label?: any
|
||||
hideLabel?: boolean
|
||||
hideIndicator?: boolean
|
||||
indicator?: "line" | "dot" | "dashed"
|
||||
nameKey?: string
|
||||
labelKey?: string
|
||||
}
|
||||
|
||||
|
||||
function ChartTooltipContent({
|
||||
active,
|
||||
payload,
|
||||
@ -118,14 +132,9 @@ function ChartTooltipContent({
|
||||
color,
|
||||
nameKey,
|
||||
labelKey,
|
||||
}: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
|
||||
React.ComponentProps<"div"> & {
|
||||
hideLabel?: boolean
|
||||
hideIndicator?: boolean
|
||||
indicator?: "line" | "dot" | "dashed"
|
||||
nameKey?: string
|
||||
labelKey?: string
|
||||
}) {
|
||||
}: ChartTooltipContentProps) {
|
||||
|
||||
|
||||
const { config } = useChart()
|
||||
|
||||
const tooltipLabel = React.useMemo(() => {
|
||||
@ -258,11 +267,13 @@ function ChartLegendContent({
|
||||
payload,
|
||||
verticalAlign = "bottom",
|
||||
nameKey,
|
||||
}: React.ComponentProps<"div"> &
|
||||
Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
||||
}: React.ComponentProps<"div"> & {
|
||||
payload?: any[]
|
||||
verticalAlign?: "top" | "middle" | "bottom"
|
||||
hideIcon?: boolean
|
||||
nameKey?: string
|
||||
}) {
|
||||
|
||||
const { config } = useChart()
|
||||
|
||||
if (!payload?.length) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user