blissfully / elm-chartjs-webcomponent / Chartjs.Chart

A type-safe bridge to a Chartjs web component.

Note: this library isn't usable without including Chartjs as a Javascript dependency in your project, along with the sister Javascript web component that goes with this library. Please see instructions here: https://github.com/Blissfully/elm-chartjs-webcomponent


type alias Chart =
{ chartType : Type
, data : Chartjs.Data.Data
, options : Chartjs.Options.Options 
}

Required definition for a Chartjs chart


type Type
    = Bar
    | Line
    | Doughnut
    | Pie

Basic type of chart

chart : Basics.Int -> Basics.Int -> Chart -> Html msg

Given dimensions and a chart, creates an HMTL node

defaultChart : Type -> Chart

Given a type, creates a sane Chart config you can update