suiss/ui · Chart
Tooltip Chart Icons
A stacked bar chart whose tooltip shows an icon for each series in place of a color swatch.
Tooltip Chart Icons is an open-source chart from suiss/ui for React. The @esuiss/ui CLI copies its source into your project, so you own the code.
A stacked bar chart whose tooltip shows a small icon for each series instead of a color swatch. Use icons when series map to recognizable things, like device types, and color alone isn't enough to tell them apart.
Installation
CLI
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Manual
- Install the dependencies:
-
Copy the source into
components/charts/tooltip-chart-icons.tsx:
- Update the import paths to match your project.
Usage
Add an icon component to each series entry in chartConfig; the tooltip picks it up automatically. Replace chartData and the series keys to match your data.
Notes
Icons replace the color indicator in every tooltip and legend that uses this config, so add them only where you want them everywhere. The tooltip opens on a preset month when the chart loads.