Chart.Tooltip

The readout. Portals to the body so no ancestor clips it.

JanFebMarAprMayJun01020304050
Chart of Projects published, Proposals accepted over 6 points
monthProjects publishedProposals accepted
January2418
February3122
March2825
April3530
May4236
June3833
<Chart.Tooltip />
<Chart.Tooltip content={<Chart.Tooltip.Content nameKey="role" hideLabel />} />

API

Chart.Tooltip

PropTypeDefault
contentReactNodeReplaces the default body.
offsetnumber12Pixels between the pointer and the panel.

Plus every <div> prop. Source: chart/components/chart-tooltip.tsx.

Chart.TooltipContent

PropTypeDefault
formatter((value: number, name: ReactNode, configKey: string) => ReactNode)Formats one series row. Use it for units and locale.
hideIndicatorbooleanfalseDrops the colour swatch from each row.
hideLabelbooleanfalseDrops the heading, leaving the series rows.
indicatorChartTooltipIndicator"dot"Shape of that swatch: a dot, a line or a filled block.
labelClassNamestringClasses for the heading row only.
labelFormatter((label: string) => ReactNode)Formats the heading — usually where a raw date becomes a readable one.
labelKeystringField holding the panel's heading. Defaults to the category.
nameKeystringField naming the config entry, for charts coloured per row.

Plus every <div> prop. Source: chart/components/chart-tooltip-content.tsx.

The default body, split out so you can restyle the rows without reimplementing the portal. On a chart coloured per row — a pie — pass nameKey, or the panel lists the series instead of the wedge under the pointer.