Module Chartjs.Interaction_mode
type tWhen configuring interaction with the graph via hover or tooltips, a number of different modes are available.
val point : t Js_of_ocaml.Js.tFinds all of the items that intersect the point.
val nearest : t Js_of_ocaml.Js.tGets the items that are at the nearest distance to the point. The nearest item is determined based on the distance to the center of the chart item (point, bar). You can use the
axissetting to define which directions are used in distance calculation. Ifintersectistrue, this is only triggered when the mouse position intersects an item in the graph. This is very useful for combo charts where points are hidden behind bars.
val index : t Js_of_ocaml.Js.tFinds item at the same index. If the
intersectsetting istrue, the first intersecting item is used to determine the index in the data. Ifintersectisfalse, the nearest item in the x direction is used to determine the index. To use index mode in a chart like the horizontal bar chart, where we search along the y direction, you can use theaxissetting introduced in v2.7.0. By setting this value to'y'on the y direction is used.
val dataset : t Js_of_ocaml.Js.tFinds items in the same dataset. If the
intersectsetting istrue, the first intersecting item is used to determine the index in the data. Ifintersectisfalse, the nearest item is used to determine the index.
val x : t Js_of_ocaml.Js.tReturns all items that would intersect based on the
Xcoordinate of the position only. Would be useful for a vertical cursor implementation. Note that this only applies to cartesian charts.
val y : t Js_of_ocaml.Js.tReturns all items that would intersect based on the
Ycoordinate of the position. This would be useful for a horizontal cursor implementation. Note that this only applies to cartesian charts.
val of_string : string -> t Js_of_ocaml.Js.t