Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/mthiems/elm-charts is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 1.0.0 found (50 same-name repos checked); no cached copy. Use another version.
Render plain SVG chart elements!
If the options in the Chart module does not fit your needs, perhaps
you need to render some custom SVG. This is the low level SVG helpers I
use in the library, and you can use them however you'd like too. You can
embed your own SVG into your chart by using the Chart.svg and Chart.svgAt
functions.
import Chart as C
import Chart.Svg as CS
import Svg as S
view : Html msg
view =
C.chart []
[ C.svg <| \plane ->
CS.label plane [] [ S.text "my custom label" ] { x = 5, y = 5 }
]Most of the configuration of these functions are directly parallel to those
of Chart, except you need to pass a Plane type in the first argument.
You can see what attributes are applicable given their configuration record.
Generate a "nice" set of type a.
Like Chart.tooltip, except in the second argument you give position directly instead of item.
Postion arbritary SVG.
S.g [ position plane x y xOff yOff ] [ ... ]Postion arbritary HTML.
positionHtml plane x y xOff yOff [] [ .. ]This is the key information about the coordinate system of your chart. Using this you'll be able to translate cartesian coordinates into SVG ones and back.
Information about your range or domain.
Translate a SVG coordinate to cartesian.
Translate a cartesian coordinate to SVG.
How long is a cartesian x length in SVG units?
How long is a cartesian y length in SVG units?
How long is a SVG x length in cartesian units?
How long is a SVG y length in cartesian units?
Hide overflow. Sometimes your element might reach outside the chart area. This will cut the excess.
Search a list for the nearest item. Example use:
C.withBars <| \plane bars ->
let closest = CS.getNearest (CE.getPosition plane) bars plane { x = 2, y = 4 } in
[ C.each closest <| \_ bar -> [ C.label [] [ S.text "nearest" ] (CE.getBottom plane bar) ]
]Like getNearest, but only searches x coordinates.
Like getNearest, but include searched radius in first argument.
Like getWithin, but only searches x coordinates.