mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Return all items that are at the nearest distance to the point and add unit tests for nearest + axis: 'x' and nearest + axis: 'y'
Interactions
The hover configuration is passed into the options.hover namespace. The global hover configuration is at Chart.defaults.global.hover. To configure which events trigger chart interactions, see events.
| Name | Type | Default | Description |
|---|---|---|---|
mode |
String |
'nearest' |
Sets which elements appear in the tooltip. See Interaction Modes for details. |
intersect |
Boolean |
true |
if true, the hover mode only applies when the mouse position intersects an item on the chart. |
axis |
String |
'x' |
Can be set to 'x', 'y', or 'xy' to define which directions are used in calculating distances. Defaults to 'x' for index mode and 'xy' in dataset and nearest modes. |
animationDuration |
Number |
400 |
Duration in milliseconds it takes to animate hover style changes. |