indicatrix/elm-chartjs-webcomponent/1.0.0

NOTE: the latest version is 3.0.0

Chartjs.DataSets.Bar

A bar chart provides a way of showing data values represented as vertical bars.

type alias DataSet =
{ label : String
, data : List Float
, xAxisID : Maybe String
, yAxisID : Maybe String
, backgroundColor : Maybe (PointProperty Color)
, borderColor : Maybe (PointProperty Color)
, borderWidth : Maybe (PointProperty Float)
, borderSkipped : Maybe String
, hoverBackgroundColor : Maybe (PointProperty Color)
, hoverBorderColor : Maybe (PointProperty Color)
, hoverBorderWidth : Maybe (PointProperty Float)
}

For further information on these properties, see https://www.chartjs.org/docs/latest/charts/bar.html

You should not use the dataset type directly Instead use the updater pipeline functions:

defaultBarFromLabel "Example"
    |> setBackgroundColor (Common.All Color.red)
    |> setBorderColor (Common.All Color.white)
defaultBarFromLabel : String -> DataSet

Create a Bar dataset with just a label

defaultBarFromData : String -> List Float -> DataSet

Create a Bar dataset with a label and data

setData : List Float -> DataSet -> DataSet

Set the data displayed by this dataset This is a list of floats, where each float is represented as a bar

setXAxisID : String -> DataSet -> DataSet

The ID of the X axis to plot the dataset on

setYAxisID : String -> DataSet -> DataSet

The ID of the Y axis to plot the dataset on

setBackgroundColor : PointProperty Color -> DataSet -> DataSet

Fill color of the bar

setBorderColor : PointProperty Color -> DataSet -> DataSet

Border color of the bar

setBorderWidth : PointProperty Float -> DataSet -> DataSet

Stroke width of the bar in pixels

setBorderSkipped : String -> DataSet -> DataSet

Which edge to skip drawing border for One of: 'bottom' 'left' 'top' 'right'

setHoverBackgroundColor : PointProperty Color -> DataSet -> DataSet

Fill color of the bar when hovered

setHoverBorderColor : PointProperty Color -> DataSet -> DataSet

Border color of the bar when hovered

setHoverBorderWidth : PointProperty Float -> DataSet -> DataSet

Border width of the bar when hovered