terezka/elm-plot/4.0.0

NOTE: this package is not compatible with Elm 0.19.1

Plot.Grid

Attributes for altering the view of your grid.

myGrid : Plot.Element (Interaction YourMsg)
myGrid =
    line
        [ stroke "deeppink"
        , strokeWidth 2
        , opacity 0.5
        , customAttrs
            [ Svg.Events.onClick <| Custom MyClickMsg
            , Svg.Events.onMouseOver <| Custom Glow
            ]
        ]
        areaDataPoints

Definition

type alias Attribute a =
Config a -> Config a

Styling

lines : List (Attribute msg) -> Attribute msg

Configure the view of the grid lines.

classes : List String -> Attribute a

Adds classes to the grid container.

myGrid : Plot.Element msg
myGrid =
    verticalGrid [ Grid.classes [ "my-grid" ] ]

Values

values : List Float -> Attribute a

Specify a list of ticks where you want grid lines drawn.

myGrid : Plot.Element msg
myGrid =
    verticalGrid [ Grid.values [ 2, 4, 6 ] ]

If values are not specified with this attribute, the grid will mirror the ticks.

Others

customAttrs : List (Attribute a) -> Attribute a

Add your own attributes to your gridlines. For events, see this example