Module Chartjs
module Indexable : sig ... endmodule Scriptable : sig ... endmodule Scriptable_indexable : sig ... endmodule Line_cap : sig ... endmodule Line_join : sig ... endmodule Interaction_mode : sig ... endmodule Point_style : sig ... endmodule Easing : sig ... endmodule Padding : sig ... endmodule Color : sig ... endmodule Position : sig ... endmodule Tooltip_position : sig ... endmodule Line_height : sig ... endmodule Hover_axis : sig ... endmodule Fill : sig ... endmodule Time : sig ... endmodule Or_false : sig ... endmodule Time_ticks_source : sig ... endmodule Time_distribution : sig ... endmodule Time_bounds : sig ... endmodule Time_unit : sig ... endmodule Interpolation_mode : sig ... endmodule Stepped_line : sig ... endmodule Line_fill : sig ... endmodule Pie_border_align : sig ... endmodule Axis_display : sig ... endmodule Time_parser : sig ... endmodule Bar_thickness : sig ... endtype 'a tick_cb= ('a -> int -> 'a Js_of_ocaml.Js.js_array Js_of_ocaml.Js.t) Js_of_ocaml.Js.callbacktype ('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 ... endclass type ['t, 'y] dataPointT = object ... endclass type ['x, 'y, 'r] dataPointR = object ... endval create_data_point : x:'a -> y:'b -> ('a, 'b) dataPoint Js_of_ocaml.Js.tval create_data_point_t : t:'a -> y:'b -> ('a, 'b) dataPointT Js_of_ocaml.Js.tval create_data_point_r : x:'a -> y:'b -> r:'c -> ('a, 'b, 'c) dataPointR Js_of_ocaml.Js.t
Axes
class type minorTicks = object ... endThe minorTick configuration is nested under the ticks configuration in the
minorkey. It defines options for the minor tick marks that are generated by the axis. Omitted options are inherited from ticks configuration.
and majorTicks = minorTicksThe majorTick configuration is nested under the ticks configuration in the
majorkey. 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 ... endThe 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 ... endand gridLines = object ... endclass type axis = object ... endval empty_minor_ticks : unit -> minorTicks Js_of_ocaml.Js.tval empty_major_ticks : unit -> majorTicks Js_of_ocaml.Js.tval empty_ticks : unit -> ticks Js_of_ocaml.Js.tval empty_scale_label : unit -> scaleLabel Js_of_ocaml.Js.tval empty_grid_lines : unit -> gridLines Js_of_ocaml.Js.t
Cartesian axes
class type cartesianTicks = object ... endclass type cartesianAxis = object ... endval coerce_cartesian_axis : cartesianAxis Js_of_ocaml.Js.t -> cartesianAxis Js_of_ocaml.Js.tval empty_cartesian_axis : unit -> cartesianAxis Js_of_ocaml.Js.t
Category axis
class type categoryTicks = object ... endclass type categoryAxis = object ... endval empty_category_ticks : unit -> categoryTicks Js_of_ocaml.Js.tval empty_category_axis : unit -> categoryAxis Js_of_ocaml.Js.t
Linear axis
class type linearTicks = object ... endclass type linearAxis = object ... endval empty_linear_ticks : unit -> linearTicks Js_of_ocaml.Js.tval empty_linear_axis : unit -> linearAxis Js_of_ocaml.Js.t
Logarithmic axis
class type logarithmicTicks = object ... endclass type logarithmicAxis = object ... endval empty_logarithmic_ticks : unit -> logarithmicTicks Js_of_ocaml.Js.tval empty_logarithmic_axis : unit -> logarithmicAxis Js_of_ocaml.Js.t
Time axis
class type timeDisplayFormats = object ... endThe following display formats are used to configure how different time units are formed into strings for the axis tick marks.
class type timeTicks = object ... endclass type timeOptions = object ... endclass type timeAxis = object ... endval empty_time_display_formats : unit -> timeDisplayFormats Js_of_ocaml.Js.tval empty_time_ticks : unit -> timeTicks Js_of_ocaml.Js.tval empty_time_options : unit -> timeOptions Js_of_ocaml.Js.tval empty_time_axis : unit -> timeAxis Js_of_ocaml.Js.t
class type dataset = object ... endclass type data = object ... endval empty_data : unit -> data Js_of_ocaml.Js.t
Chart configuration
class type updateConfig = object ... endAnimation
class type animationItem = object ... endand animation = object ... endLayout
and layout = object ... endLegend
and legendItem = object ... endand legendLabels = object ... endand legend = object ... endTitle
and title = object ... endTooltip
and tooltipItem = object ... endand tooltipBodyLines = object ... endand tooltipModel = object ... endand tooltipCallbacks = object ... endand tooltip = object ... endInteractions
and hover = object ... endElements
and pointElement = object ... endand lineElement = object ... endand rectangleElement = object ... endand arcElement = object ... endand elements = object ... endOptions
and chartSize = object ... endChart
and chartOptions = object ... endThe configuration is used to change how the chart behaves. There are properties to control styling, fonts, the legend, etc.
and chartConfig = object ... endand chart = object ... endval empty_animation : unit -> animation Js_of_ocaml.Js.tval empty_layout : unit -> layout Js_of_ocaml.Js.tval empty_legend_labels : unit -> legendLabels Js_of_ocaml.Js.tval empty_legend : unit -> legend Js_of_ocaml.Js.tval empty_title : unit -> title Js_of_ocaml.Js.tval empty_tooltip_model : unit -> tooltipModel Js_of_ocaml.Js.tval empty_tooltip_callbacks : unit -> tooltipCallbacks Js_of_ocaml.Js.tval empty_tooltip : unit -> tooltip Js_of_ocaml.Js.tval empty_hover : unit -> hover Js_of_ocaml.Js.tval empty_point_element : unit -> pointElement Js_of_ocaml.Js.tval empty_line_element : unit -> lineElement Js_of_ocaml.Js.tval empty_rectangle_element : unit -> rectangleElement Js_of_ocaml.Js.tval empty_arc_element : unit -> arcElement Js_of_ocaml.Js.tval empty_elements : unit -> elements Js_of_ocaml.Js.tval empty_update_config : unit -> updateConfig Js_of_ocaml.Js.t
Charts
Line Chart
class type 'a lineOptionContext = object ... endand lineScales = object ... endand lineOptions = object ... endand lineConfig = object ... endand 'a lineDataset = object ... endand lineChart = object ... endval empty_line_scales : unit -> lineScales Js_of_ocaml.Js.tval empty_line_options : unit -> lineOptions Js_of_ocaml.Js.tval empty_line_dataset : unit -> 'a lineDataset Js_of_ocaml.Js.t
Bar Chart
class type barAxis = object ... endclass type cateroryBarAxis = object ... endclass type linearBarAxis = object ... endclass type logarithmicBarAxis = object ... endclass type timeBarAxis = object ... endclass type barScales = object ... endclass type 'a barOptionContext = object ... endand barOptions = object ... endand barConfig = object ... endand 'a barDataset = object ... endand barChart = object ... endval empty_bar_axis : unit -> cateroryBarAxis Js_of_ocaml.Js.tval empty_linear_bar_axis : unit -> linearBarAxis Js_of_ocaml.Js.tval empty_logarithmic_bar_axis : unit -> logarithmicBarAxis Js_of_ocaml.Js.tval empty_time_bar_axis : unit -> timeBarAxis Js_of_ocaml.Js.tval empty_bar_scales : unit -> barScales Js_of_ocaml.Js.tval empty_bar_options : unit -> barOptions Js_of_ocaml.Js.tval empty_bar_dataset : unit -> 'a barDataset Js_of_ocaml.Js.t
Pie Chart
class type 'a pieOptionContext = object ... endand pieAnimation = object ... endand pieOptions = object ... endand pieConfig = object ... endand 'a pieDataset = object ... endand pieChart = object ... endval empty_pie_animation : unit -> pieAnimation Js_of_ocaml.Js.tval empty_pie_options : unit -> pieOptions Js_of_ocaml.Js.tval empty_pie_dataset : unit -> 'a pieDataset Js_of_ocaml.Js.t
module Axis : sig ... endmodule Chart : sig ... endType Coercion
module CoerceTo : sig ... endCreating 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.tval 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.tval 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