package chartjs

  1. Overview
  2. Docs
type t

When configuring interaction with the graph via hover or tooltips, a number of different modes are available.

val point : t Js_of_ocaml.Js.t

Finds all of the items that intersect the point.

val nearest : t Js_of_ocaml.Js.t

Gets 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 axis setting to define which directions are used in distance calculation. If intersect is true, 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.t

Finds item at the same index. If the intersect setting is true, the first intersecting item is used to determine the index in the data. If intersect is false, 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 the axis setting introduced in v2.7.0. By setting this value to 'y' on the y direction is used.

val dataset : t Js_of_ocaml.Js.t

Finds items in the same dataset. If the intersect setting is true, the first intersecting item is used to determine the index in the data. If intersect is false, the nearest item is used to determine the index.

Returns all items that would intersect based on the X coordinate of the position only. Would be useful for a vertical cursor implementation. Note that this only applies to cartesian charts.

Returns all items that would intersect based on the Y coordinate 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
OCaml

Innovation. Community. Security.