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).
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"Set chart width in pixels. Default: 500.
Set chart height in pixels. Default: 250.
Apply a Theme.
Override the main series color.
Set the x-axis label.
Set the y-axis label.
Set the chart title.
Add a horizontal threshold line.
chart
|> Threshold.withThresholdLabel 80 "#f0ab00" "Warning (80%)"Show a skeleton placeholder instead of the chart while data is loading.
Render to Html msg.
An opaque threshold chart configuration.