jweir/charter/2.1.1

NOTE: the latest version is 2.2.1

Charter.Extras

Additional functions to help in generating the graphs.

Definition

minMax : Axes -> List ( Float, Float ) -> ( Float, Float )

Returns the min and max value for the given Axis. An empty list will return (0,0)

type Axes
= X
| Y

Describes which axes on the graph or from the data to use.

step : Step -> List ( Float, Float ) -> List ( Float, Float )

step modifies the input data so it will be drawn with a step on the Y axis.

type Step
= Before
| After

Defines where the step will occur

intersect : Axes -> Float -> List ( Float, Float ) -> Maybe ( Float, Float )

Attempt to find a point where a given value intersects with a dataset along either the X or Y axis.

This function is not optimized.