Skip to main content
Charts are interactive by default. Hovering highlights the nearest observation and shows a tooltip; no configuration is needed.
How the highlight and the de-emphasis around it are painted is a style question — see Restyling hover and dimming below.

How hover works

Hit-testing runs in the engine, and which query answers depends on the geom:
  • Banded and bucketed cartesian geoms — bars, lines, areas — snap along the main axis: the coordinate the categories or buckets run along, which is x for a vertical bar or line chart and y for a horizontal bar chart. The cursor never has to land exactly on an observation, which is why a line chart responds smoothly between vertices. Everything at that main-axis position highlights together — every segment in a stack, every series in a multi-line chart — and the tooltip lists their values in legend order.
  • Point layers — scatter — use nearest-neighbour in 2D, so the closest marker wins rather than the nearest column.
  • Polar charts — pie and donut — hit-test the enclosing arc: the slice the cursor is inside.
  • Grid layersheatmaps — hit-test the enclosing cell, over its full band rather than the inset tile painted inside it. Cells the data leaves empty answer no hover.
Custom geoms answer their own hit-test queries. Layers can opt out with interactive: false — useful for a decorative point overlay that shouldn’t compete with the line beneath it:
A non-interactive layer is filtered out before both hit-testing and grouping, so it never wins a hover and never appears as a companion row in another layer’s tooltip. It is visual decoration as far as hover is concerned. Marker diameter is a style, not a geom parameter:

Restyling hover and dimming

Hover and de-emphasis are painted through two style states, hovered and dimmed, that any geom entry can scope to. dimmed covers both cases where an element steps back — a highlight matched something else, or the pointer is on another element. States are paint-only: they never feed layout, so nothing moves when the pointer does.
Out of the box, dimmed drops a mark to alpha: 0.4, and hovered bars and points gain a white affordance border. See Styling for the full cascade.

Tooltips

Tooltips are on by default. Turn them off with showTooltips:
To change how the tooltip looks, replace it with the Tooltip slot. It receives TooltipSlotProps — a single content prop carrying the render-ready rows the default tooltip gets, already formatted. Positioning stays built in. DefaultTooltip is exported, so a custom tooltip can wrap it rather than rebuild it:

Animation

A graph animates by default: an intro entrance on first mount, and transitions between compiled states when the data or a config value changes. Pass animation to turn either kind off, or to tune the intro:
The intro takes five settings:
boolean
default:"true"
Whether the entrance plays at all. Passing intro: false is the same thing.
number
default:"1"
Multiplier applied to every entrance duration and stagger delay.
boolean
default:"true"
Whether geoms that support a staggered entrance enter one after another rather than all at once.
IntroStaggerOrder
default:"main-axis"
The order staggered point geoms enter in. Bars and slices always enter in visual order.
number
default:"1500"
Total geom count across all layers above which the entrance is skipped entirely — which is why a very dense chart appears without animating.
A viewer who prefers reduced motion gets no animation whatever this asks for.
  • Styling — the hovered and dimmed states, and everything else the chart paints
  • Slots — replace the tooltip or other regions
  • Provider & renderershowTooltips, animation, mode