lauber00/line-charts/1.0.3

Renamed to volgariver6/line-charts. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as lauber00/line-charts still install under that name. 4 versions of 4 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/volgariver6/line-charts.

What we checked: The repo moved to github.com/volgariver6/line-charts. Rebuilt with git archive from commit d68ee83c9316 of https://github.com/volgariver6/line-charts (zip prefix lauber00-line-charts-ec0c8ea/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 1d2d5061fac32e0920f5c86bf94648f2ee5bd718.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/lauber00/line-charts/zipball/1.0.3/

LineChart.Axis.Title

type alias Config msg =
Config msg

Part of the configuration in Axis.custom.

axisConfig : Axis.Config Data msg
axisConfig =
  Axis.custom
    { title = Title.default
    , ...
    }
default : String -> Config msg

Place the title at the maxima of your axis range.

atAxisMax : Float -> Float -> String -> Config msg

Place the title at the maxima of your axis range. Arguments:

  1. The x offset in SVG-space.
  2. The y offset in SVG-space.
  3. The title.
titleConfig : Title.Config msg
titleConfig =
  Title.atAxisMax 0 10 "Age"

See full example here.

atDataMax : Float -> Float -> String -> Config msg

Place the title at the maxima of your data range. Arguments:

  1. The x offset in SVG-space.
  2. The y offset in SVG-space.
  3. The title.
titleConfig : Title.Config msg
titleConfig =
  Title.atDataMax 0 10 "Age"

See full example here.

atPosition : (Range -> Range -> Float) -> Float -> Float -> String -> Config msg

Place your title in any spot along your axis. Arguments:

  1. Given the data range and axis range, provide a position.
  2. The x offset in SVG-space.
  3. The y offset in SVG-space.
  4. The title.
titleConfig : Title.Config msg
titleConfig =
  let position dataRange axisRange = 80 in
  Title.atPosition position -15 30 "Weight"

See full example here.

custom : (Range -> Range -> Float) -> Float -> Float -> Svg msg -> Config msg

Almost the same as atPosition except instead of a string title, you pass a SVG title. Arguments:

  1. Given the data range and axis range, provide a position.
  2. The x offset in SVG-space.
  3. The y offset in SVG-space.
  4. The title view.
titleConfig : Title.Config msg
titleConfig =
  let position dataRange axisRange = middle axisRange in
  Title.custom position -10 35 <|
    Svg.g
      [ Svg.Attributes.style "text-anchor: middle;" ]
      [ Junk.label Colors.pink "Weight" ]


middle : Coordinate.Range -> Float
middle { min, max } =
  min + (max - min) / 2

See full example here.