leojpod / elm-apex-charts-link / Charts.RoundChart

Use this module to create pie charts, radial charts (and all kind of roundly shaped charts). These charts generally work with either 1 single value or a single series of values

Building a chart


type RoundChart

The opaque type representing RoundCharts

Start

pieChart : String -> List ( String, Basics.Float ) -> RoundChart

Creates a pie chart with the given title and series

radialBar : String -> List ( String, Basics.Float ) -> RoundChart

Create a radial bar chart with the given title and series

Note for a simple "gauge"-type chart, simply give a single-item list as series.

Customizations

withCustomAngles : Basics.Int -> Basics.Int -> RoundChart -> RoundChart

this allows to replace the usual "full circle"/360 degree representation by one of custom angles

NOTE: angles are in degrees and 0 represent the top of the page (i.e. noon on an analog watch)

Internals

chartData : RoundChart -> RoundChartData

Internal accessor to the round chart definition

this is used to translate from RoundChart to ApexChart


type RoundChartType
    = Pie
    | Radial

Internal representation of the chart type


type alias RoundChartOptions =
{ type_ : RoundChartType
, angles : Maybe { from : Basics.Int
, to : Basics.Int } 
}

Internal type used to describe general options for the round charts