fix: Update ChartTooltipContent to handle "0" item value (#4215)

Fix #4214: Update ChartTooltipContent to handle "0" item value
This commit is contained in:
Batuhan Tomo
2024-07-10 15:08:25 +03:00
committed by GitHub
parent f6ad10abd5
commit 248347a389
4 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -196,7 +196,7 @@ const ChartTooltipContent = React.forwardRef<
indicator === "dot" && "items-center"
)}
>
{formatter && item.value && item.name ? (
{formatter && item?.value !== undefined && item.name ? (
formatter(item.value, item.name, item, index, item.payload)
) : (
<>

View File

@@ -196,7 +196,7 @@ const ChartTooltipContent = React.forwardRef<
indicator === "dot" && "items-center"
)}
>
{formatter && item.value && item.name ? (
{formatter && item?.value !== undefined && item.name ? (
formatter(item.value, item.name, item, index, item.payload)
) : (
<>