lenards/elm-patternfly-charts/1.0.1

PF6.Charts.Threshold

Threshold chart — a line chart with one or more horizontal threshold lines.

Common in infrastructure dashboards to show warning/danger levels (e.g. CPU at 80% warning, 95% critical).

Type

An opaque threshold chart configuration.

Constructor

fromData : List ( Float, Float ) -> ThresholdChart

Create a threshold chart from (x, y) data pairs.

Add thresholds using withThresholdLabel.

chart =
    Threshold.fromData cpuData
        |> Threshold.withThresholdLabel 80 "#f0ab00" "Warning"
        |> Threshold.withThresholdLabel 95 "#c9190b" "Critical"

Modifiers

Set chart width in pixels. Default: 500.

Set chart height in pixels. Default: 250.

Override the main series color.

Set the x-axis label.

Set the y-axis label.

Set the chart title.

withThresholdLabel : Float -> String -> String -> ThresholdChart -> ThresholdChart

Add a horizontal threshold line.

chart
    |> Threshold.withThresholdLabel 80 "#f0ab00" "Warning (80%)"

Show a skeleton placeholder instead of the chart while data is loading.

Renderer

toSvg : ThresholdChart -> Html msg

Render to Html msg.