suiss/ui · Chart
Tooltip Chart Interactive
A tooltip playground on quarterly revenue bars, with controls for indicator, trigger, title total and hidden parts.
Tooltip Chart Interactive 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 quarterly revenue chart with live controls for every tooltip option: indicator style, hover or click trigger, a total in the title, and hiding the title or indicator. Use it to try combinations before copying the settings into your own chart.
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:
-
Add the pieces it builds on: Card, Chart, Switch, Toggle Group.
-
Copy the source into
components/charts/tooltip-chart-interactive.tsx:
- Update the import paths to match your project.
Usage
Pick the combination you like, then copy the matching props into your chart: indicator, hideLabel and hideIndicator go on the tooltip content, and trigger on ChartTooltip. The total in the title comes from a label formatter that sums the rows.
Notes
With the click trigger, the tooltip appears only after a bar is clicked and stays in place as the pointer moves. Every control is a labeled, keyboard-operable switch or toggle group.