lauber00/line-charts/1.0.0

NOTE: the latest version is 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 e767c3b500c5 of https://github.com/volgariver6/line-charts (zip prefix lauber00-line-charts-8ed8149/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 da35244e03bdd7ae72c088a2a7ca7ba589ca943a.

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.0/

LineChart.Axis

If you're confused as to what "axis range" and "data range" means, check out Axis.Range for an explanation!

type alias Config data msg =
Config data msg

Use in the LineChart.Config passed to LineChart.viewCustom.

chartConfig : LineChart.Config data msg
chartConfig =
  { ...
  , x = Axis.default 650 "Age (years)" .age
  , y = Axis.default 400 "Weight (kg)" .weight
  , ...
  }
default : Int -> String -> (data -> Float) -> Config data msg

Draws a line the full length of your data range and adds a little space on both sides of that line. Also adds some nice ticks to it.

Pass the length of your axis in pixels, the title and it's variable.

xAxisConfig : Axis.Config Data msg
xAxisConfig =
  Axis.default 650 "Age (years)" .age

See the full example here.

full : Int -> String -> (data -> Float) -> Config data msg

Draws a line the full length of your axis range and adds some nice ticks to it.

Pass the length of your axis in pixels, the title and it's variable.

xAxisConfig : Axis.Config Data msg
xAxisConfig =
  Axis.full 650 "Age (years)" .age

See the full example here.

time : Zone -> Int -> String -> (data -> Float) -> Config data msg

Draws a line the full length of your data range and adds some nice datetime ticks to it.

Pass the length of your axis in pixels, the title and it's variable.

xAxisConfig : Axis.Config Data msg
xAxisConfig =
  Axis.time 650 "Date" .date

See the full example here.

none : Int -> (data -> Float) -> Config data msg

Doesn't draw the axis at all.

Pass the length of your axis in pixels and it's variable.

xAxisConfig : Axis.Config Data msg
xAxisConfig =
  Axis.none 650 .age

See the full example here.

picky : Int -> String -> (data -> Float) -> List Float -> Config data msg

Draws the full length of your axis range and adds some ticks at the positions specified in the last argument.

Pass the length of your axis in pixels, the title, it's variable and the numbers where you'd like ticks to show up.

xAxisConfig : Axis.Config Data msg
xAxisConfig =
  Axis.picky 650 "Age (years)" .age [ 4, 25, 46 ]

See the full example here.

Note: This is of course not the only way for you to decide exactly where the ticks should go on the axis! If you need to customize ticks further, check out the ticks property in Axis.custom.

custom : Properties data msg -> Config data msg

Properties:

  • title: Adds a title on your axis. </br> See LineChart.Axis.Title for more information and examples.
  • variable: Determines what data is drawn in the chart! </br>
  • pixels: The length of the dimension.
  • range: Determines the axis range. </br> See LineChart.Axis.Range for more information and examples.
  • axisLine: Customizes your axis line. </br> See LineChart.Axis.Line for more information and examples.
  • ticks: Customizes your ticks. </br> See LineChart.Axis.Ticks for more information and examples.xAxisConfig : Axis.Config Data msg xAxisConfig = Axis.custom { title = Title.default "Year" , variable = Just << .date , pixels = 700 , range = Range.padded 20 20 , axisLine = AxisLine.full Colors.black , ticks = Ticks.time 5 }

See the full example here.