@reincharts/tooltip
Legends and tooltips.
npm install @reincharts/tooltipEverything here is also re-exported by the umbrella package reincharts.
Components
| Name | Description |
|---|---|
| Legend | Pane legend in the top-left corner of a pane: name and values of every series at the crosshair (or the last bar). |
| Tooltip | Floating tooltip that follows the pointer: a card with the hovered x and the values of the pane's series. |
| TooltipCard | The default tooltip card (exported to build custom tooltips with the same look). |
Hooks
| Name | Description |
|---|---|
| useLegend | Legend entries of a pane at the crosshair (or the last bar when there is no crosshair). |
Functions
| Name | Description |
|---|---|
| collectLegend | Legend entries of a pane at a data index (like engine.legendItems, but keeping the renderables). |
| defaultHeader | Formatted x of a data point; numbers get a precision that suits their magnitude. |
| formatChange | Formats a change as "+1.23 (+0.52%)". |
| sameEntries | Deep equality of legend entry lists (used to skip re-renders). |
Types
| Name | Description |
|---|---|
| CollectOptions | |
| LegendEntry | |
| LegendItemContext | Context passed to renderItem / actions. |
| LegendPosition | |
| LegendProps | Props of the Legend component. |
| LegendState | |
| TooltipCardProps | Props of the TooltipCard component. |
| TooltipContent | What a tooltip shows at the hovered point. |
| TooltipProps | Props of the Tooltip component. |