shadcn.io is not affiliated with official shadcn/ui
Chart examples · Tooltip
Tooltip - No Indicator Chart for React
A chart tooltip without color indicators, showing the label, names and values.
The tooltip with hideIndicator: the title, then each series' name and value, without the color marks.
Preview
Installation
FAQ
How do I remove the color dots?
ChartTooltipContent sets hideIndicator. The dots are omitted. The title, the series names, and the values stay. This demo doesn't set indicator, so the hidden shape would have been the default dot.
What is left in each row?
The label from config, Running or Swimming, and the value with toLocaleString, in font-mono and tabular-nums. nameKey isn't set, so the lookup uses the series key, running or swimming.
What is the tooltip title?
The raw date from XAxis, like 2024-07-16, because hideLabel is not set and there is no labelFormatter. The axis itself uses tickFormatter={formatWeekday}, a short weekday. tickMargin is 10.
Why is a tooltip open on load?
ChartTooltip sets defaultIndex={1} and cursor={false}. Index 1 is the second row. cursor={false} turns the hover cursor off. BarChart sets accessibilityLayer.
Related
- Tooltip - Default ChartThe default chart tooltip, with a label
- Tooltip - Line Indicator ChartA chart tooltip with line indicators
- Tooltip - No Label ChartA chart tooltip without a label or
- A bar chartA bar chart with rounded corners
- Tooltip - Formatter ChartA chart tooltip that formats each row
- A line chartA line chart drawing one series as a