Skip to content

Interaction

Reference

Namespace: options.interaction. To configure which events trigger chart interactions, see events.

1
2
3
4
.Options(o => o
    .Interaction(i => i
        .Mode(InteractionMode.Index)
        .Axis(Axis.X)))
1
2
3
4
5
6
"options": {
    "interaction": {
      "mode": 2,
      "axis": "x"
    }
  }

Mode

Sets which elements appear in the interaction. Default 'nearest'

.Mode(InteractionMode.Index)

Intersect

if true, the interaction mode only applies when the mouse position intersects an item on the chart. Default true

.Intersect(true)

Axis

Can be set to 'x', 'y', 'xy' or 'r' to define which directions are used in calculating distances. Defaults to 'x' for 'index' mode and 'xy' in dataset and 'nearest' modes.

.Axis(Axis.X)

IncludeInvisible

if true, the invisible points that are outside of the chart area will also be included when evaluating interactions. Default false

.IncludeInvisible(true)