Module Chartjs

module Indexable : sig ... end
module Scriptable : sig ... end
module Scriptable_indexable : sig ... end
module Line_cap : sig ... end
module Line_join : sig ... end
module Interaction_mode : sig ... end
module Point_style : sig ... end
module Easing : sig ... end
module Padding : sig ... end
module Color : sig ... end
module Position : sig ... end
module Tooltip_position : sig ... end
module Line_height : sig ... end
module Hover_axis : sig ... end
module Fill : sig ... end
module Time : sig ... end
module Or_false : sig ... end
type line_dash = float Js_of_ocaml.Js.js_array Js_of_ocaml.Js.t
see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
type line_dash_offset = float
see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset
module Time_ticks_source : sig ... end
module Time_distribution : sig ... end
module Time_bounds : sig ... end
module Time_unit : sig ... end
module Interpolation_mode : sig ... end
module Stepped_line : sig ... end
module Line_fill : sig ... end
module Pie_border_align : sig ... end
module Axis_display : sig ... end
module Time_parser : sig ... end
module Bar_thickness : sig ... end
type 'a tick_cb = ('a -> int -> 'a Js_of_ocaml.Js.js_array Js_of_ocaml.Js.t) Js_of_ocaml.Js.callback
type ('a, 'b, 'c) tooltip_cb = ('a'b -> 'c -> Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t Indexable.t Js_of_ocaml.Js.t) Js_of_ocaml.Js.meth_callback Js_of_ocaml.Js.optdef
class type ['x, 'y] dataPoint = object ... end
class type ['t, 'y] dataPointT = object ... end
class type ['x, 'y, 'r] dataPointR = object ... end
val create_data_point : x:'a -> y:'b -> ('a'b) dataPoint Js_of_ocaml.Js.t
val create_data_point_t : t:'a -> y:'b -> ('a'b) dataPointT Js_of_ocaml.Js.t
val create_data_point_r : x:'a -> y:'b -> r:'c -> ('a'b'c) dataPointR Js_of_ocaml.Js.t

Axes

class type minorTicks = object ... end

The minorTick configuration is nested under the ticks configuration in the minor key. It defines options for the minor tick marks that are generated by the axis. Omitted options are inherited from ticks configuration.

and majorTicks = minorTicks

The majorTick configuration is nested under the ticks configuration in the major key. It defines options for the major tick marks that are generated by the axis. Omitted options are inherited from ticks configuration. These options are disabled by default.

and ticks = object ... end

The tick configuration is nested under the scale configuration in the ticks key. It defines options for the tick marks that are generated by the axis.

and scaleLabel = object ... end
and gridLines = object ... end
class type axis = object ... end
val empty_minor_ticks : unit -> minorTicks Js_of_ocaml.Js.t
val empty_major_ticks : unit -> majorTicks Js_of_ocaml.Js.t
val empty_ticks : unit -> ticks Js_of_ocaml.Js.t
val empty_scale_label : unit -> scaleLabel Js_of_ocaml.Js.t
val empty_grid_lines : unit -> gridLines Js_of_ocaml.Js.t

Cartesian axes

class type cartesianTicks = object ... end
class type cartesianAxis = object ... end
val coerce_cartesian_axis : cartesianAxis Js_of_ocaml.Js.t -> cartesianAxis Js_of_ocaml.Js.t
val empty_cartesian_axis : unit -> cartesianAxis Js_of_ocaml.Js.t

Category axis

class type categoryTicks = object ... end
class type categoryAxis = object ... end
val empty_category_ticks : unit -> categoryTicks Js_of_ocaml.Js.t
val empty_category_axis : unit -> categoryAxis Js_of_ocaml.Js.t

Linear axis

class type linearTicks = object ... end
class type linearAxis = object ... end
val empty_linear_ticks : unit -> linearTicks Js_of_ocaml.Js.t
val empty_linear_axis : unit -> linearAxis Js_of_ocaml.Js.t

Logarithmic axis

class type logarithmicTicks = object ... end
class type logarithmicAxis = object ... end
val empty_logarithmic_ticks : unit -> logarithmicTicks Js_of_ocaml.Js.t
val empty_logarithmic_axis : unit -> logarithmicAxis Js_of_ocaml.Js.t

Time axis

class type timeDisplayFormats = object ... end

The following display formats are used to configure how different time units are formed into strings for the axis tick marks.

class type timeTicks = object ... end
class type timeOptions = object ... end
class type timeAxis = object ... end
val empty_time_display_formats : unit -> timeDisplayFormats Js_of_ocaml.Js.t
val empty_time_ticks : unit -> timeTicks Js_of_ocaml.Js.t
val empty_time_options : unit -> timeOptions Js_of_ocaml.Js.t
val empty_time_axis : unit -> timeAxis Js_of_ocaml.Js.t
class type dataset = object ... end
val coerce_dataset : dataset Js_of_ocaml.Js.t -> dataset Js_of_ocaml.Js.t
class type data = object ... end
val empty_data : unit -> data Js_of_ocaml.Js.t

Chart configuration

class type updateConfig = object ... end

Animation

class type animationItem = object ... end
and animation = object ... end

Layout

and layout = object ... end

Legend

and legendItem = object ... end
and legendLabels = object ... end
and legend = object ... end

Title

and title = object ... end

Tooltip

and tooltipItem = object ... end
and tooltipBodyLines = object ... end
and tooltipModel = object ... end
and tooltipCallbacks = object ... end
and tooltip = object ... end

Interactions

and hover = object ... end

Elements

and pointElement = object ... end
and lineElement = object ... end
and rectangleElement = object ... end
and arcElement = object ... end
and elements = object ... end

Options

and chartSize = object ... end

Chart

and chartOptions = object ... end

The configuration is used to change how the chart behaves. There are properties to control styling, fonts, the legend, etc.

and chartConfig = object ... end
and chart = object ... end
val empty_animation : unit -> animation Js_of_ocaml.Js.t
val empty_layout : unit -> layout Js_of_ocaml.Js.t
val empty_legend_labels : unit -> legendLabels Js_of_ocaml.Js.t
val empty_legend : unit -> legend Js_of_ocaml.Js.t
val empty_title : unit -> title Js_of_ocaml.Js.t
val empty_tooltip_model : unit -> tooltipModel Js_of_ocaml.Js.t
val empty_tooltip_callbacks : unit -> tooltipCallbacks Js_of_ocaml.Js.t
val empty_tooltip : unit -> tooltip Js_of_ocaml.Js.t
val empty_hover : unit -> hover Js_of_ocaml.Js.t
val empty_point_element : unit -> pointElement Js_of_ocaml.Js.t
val empty_line_element : unit -> lineElement Js_of_ocaml.Js.t
val empty_rectangle_element : unit -> rectangleElement Js_of_ocaml.Js.t
val empty_arc_element : unit -> arcElement Js_of_ocaml.Js.t
val empty_elements : unit -> elements Js_of_ocaml.Js.t
val empty_update_config : unit -> updateConfig Js_of_ocaml.Js.t

Charts

Line Chart

class type 'a lineOptionContext = object ... end
and lineScales = object ... end
and lineOptions = object ... end
and lineConfig = object ... end
and 'a lineDataset = object ... end
and lineChart = object ... end
val empty_line_scales : unit -> lineScales Js_of_ocaml.Js.t
val empty_line_options : unit -> lineOptions Js_of_ocaml.Js.t
val empty_line_dataset : unit -> 'a lineDataset Js_of_ocaml.Js.t

Bar Chart

class type barAxis = object ... end
class type cateroryBarAxis = object ... end
class type linearBarAxis = object ... end
class type logarithmicBarAxis = object ... end
class type timeBarAxis = object ... end
class type barScales = object ... end
class type 'a barOptionContext = object ... end
and barOptions = object ... end
and barConfig = object ... end
and 'a barDataset = object ... end
and barChart = object ... end
val empty_bar_axis : unit -> cateroryBarAxis Js_of_ocaml.Js.t
val empty_linear_bar_axis : unit -> linearBarAxis Js_of_ocaml.Js.t
val empty_logarithmic_bar_axis : unit -> logarithmicBarAxis Js_of_ocaml.Js.t
val empty_time_bar_axis : unit -> timeBarAxis Js_of_ocaml.Js.t
val empty_bar_scales : unit -> barScales Js_of_ocaml.Js.t
val empty_bar_options : unit -> barOptions Js_of_ocaml.Js.t
val empty_bar_dataset : unit -> 'a barDataset Js_of_ocaml.Js.t

Pie Chart

class type 'a pieOptionContext = object ... end
and pieAnimation = object ... end
and pieOptions = object ... end
and pieConfig = object ... end
and 'a pieDataset = object ... end
and pieChart = object ... end
val empty_pie_animation : unit -> pieAnimation Js_of_ocaml.Js.t
val empty_pie_options : unit -> pieOptions Js_of_ocaml.Js.t
val empty_pie_dataset : unit -> 'a pieDataset Js_of_ocaml.Js.t
module Axis : sig ... end
module Chart : sig ... end

Type Coercion

module CoerceTo : sig ... end

Creating an Axis

val create_axis : 'a Axis.typ -> 'a Js_of_ocaml.Js.t

Creating a Chart

val chart_from_canvas : 'a Chart.typ -> data Js_of_ocaml.Js.t -> chartOptions Js_of_ocaml.Js.t -> Js_of_ocaml.Dom_html.canvasElement Js_of_ocaml.Js.t -> 'a Js_of_ocaml.Js.t
val chart_from_ctx : 'a Chart.typ -> data Js_of_ocaml.Js.t -> chartOptions Js_of_ocaml.Js.t -> Js_of_ocaml.Dom_html.canvasRenderingContext2D Js_of_ocaml.Js.t -> 'a Js_of_ocaml.Js.t
val chart_from_id : 'a Chart.typ -> data Js_of_ocaml.Js.t -> chartOptions Js_of_ocaml.Js.t -> string -> 'a Js_of_ocaml.Js.t