package chartjs

  1. Overview
  2. Docs
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
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
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.

class type 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.

class type 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.

class type scaleLabel = object ... end
class type 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 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
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
class type animation = object ... end

Layout

class type layout = object ... end

Legend

class type legendItem = object ... end
class type legendLabels = object ... end
class type legend = object ... end

Title

class type title = object ... end

Tooltip

class type tooltipItem = object ... end
class type tooltipBodyLines = object ... end
class type tooltipModel = object ... end
class type tooltipCallbacks = object ... end
class type tooltip = object ... end

Interactions

class type hover = object ... end

Elements

class type pointElement = object ... end
class type lineElement = object ... end
class type rectangleElement = object ... end
class type arcElement = object ... end
class type elements = object ... end

Options

class type chartSize = object ... end

Chart

class type chartOptions = object ... end

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

class type chartConfig = object ... end
class type 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
class type lineScales = object ... end
class type lineOptions = object ... end
class type lineConfig = object ... end
class type 'a lineDataset = object ... end
class type 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
class type barOptions = object ... end
class type barConfig = object ... end
class type 'a barDataset = object ... end
class type 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
class type pieAnimation = object ... end
class type pieOptions = object ... end
class type pieConfig = object ... end
class type 'a pieDataset = object ... end
class type 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_id : 'a Chart.typ -> data Js_of_ocaml.Js.t -> chartOptions Js_of_ocaml.Js.t -> string -> 'a Js_of_ocaml.Js.t
OCaml

Innovation. Community. Security.