package c3

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

A line chart

type kind = [
  1. | `Timeseries
  2. | `XY
]

A line chart can show either timeseries data or arbitrary values on the X axis.

type t

An unrendered line chart

val make : ?x_format:string -> ?x_label:string -> ?y_label:string -> kind:kind -> unit -> t

Create an unrendered line chart, showing either `Timeseries or `XY data. The ?x_format is a format string for the labels on the x axis.

val add : segment:Segment.t -> t -> t

Add a line segment to an unrendered line chart.

val add_group : segments:Segment.t list -> t -> t

Add a group of line segments to an unrendered line chart. By grouping line segments they will be rendered stacked.

type display

A rendered line chart

val render : bindto:string -> t -> display

A rendered line chart

val flow : segments:Segment.t list -> ?flow_to:flow_to -> display -> unit

Dynamically extend a rendered line chart by adding a list of segments. The ?flow_to parameter customises how the chart will be added.

val update : segments:Segment.t list -> display -> unit

Replace the segments in an existing rendered chart with new ones. The old segments with the same label will be removed and replaced.

OCaml

Innovation. Community. Security.