Skip to content

Commit cf3980b

Browse files
authored
Merge pull request #1057 from buildo/fix-donut-tooltip
fix(donut-chart): show item color in tooltip
2 parents ac07f79 + 45c991f commit cf3980b

File tree

1 file changed

+2
-1
lines changed
  • packages/bento-design-system/src/Charts/Tooltip

1 file changed

+2
-1
lines changed

packages/bento-design-system/src/Charts/Tooltip/Tooltip.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ export const useTooltip = <TValue extends ValueType, TName extends NameType>(
4747
: typeof formatterResult === "string" || typeof formatterResult === "number"
4848
? `${name}: ${formatterResult}`
4949
: `${name}: ${value}`;
50+
const tooltipColor = color ?? item.fill;
5051
return (
5152
<Columns key={name} space={4} alignY="center">
5253
<Column width="content">
5354
<Box
5455
height={16}
5556
width={16}
5657
borderRadius={4}
57-
style={{ backgroundColor: color }}
58+
style={{ backgroundColor: tooltipColor }}
5859
/>
5960
</Column>
6061
<Body size="small">{formattedText}</Body>

0 commit comments

Comments
 (0)