terezka/elm-plot/3.0.0

NOTE: this package is not compatible with Elm 0.19.1

Plot.Bars

Attributes for altering the view of your bars serie.

myBarsSerie : Plot.Element (Interaction YourMsg)
myBarsSerie =
    pile
        []
        [ Pile.bars
            [ Bars.fill "pink"
            , Bars.opacity 0.5
            ]
            data
        ]

Definition

type alias Attribute a =
Config a -> Config a

Styling

opacity : Float -> Attribute a

Set the opacity.

fill : String -> Attribute a

Set the fill color.

Label

label : (Float -> Svg a) -> Attribute a

Use your own view for your label on top of bar. Will be passed the y value as an argument!

myBarSeries : Pile.Element msg
myBarSeries =
  Pile.bars
      [ Bars.label (\_ -> Svg.text_ [] [ Svg.text "my bar" ])
      ]
      data

Other

customAttrs : List (Attribute a) -> Attribute a

Add your own attributes. For events, see this example