lenards/elm-patternfly-charts/1.0.1

PF6.Charts.Scatter

Scatter chart — discrete data points on a 2D Cartesian plane.

Supports multiple series with automatic color assignment, and optional line or area overlays connecting each series' points.

Types

An opaque scatter chart configuration.

type alias Series =
{ label : String
, data : List ( Float, Float )
}

A named series of (x, y) scatter points.

type Overlay
= NoOverlay
| WithLine
| WithArea

Optional overlay drawn on top of scatter points.

  • NoOverlay — points only (default).
  • WithLine — connects each series' points with a line (sorted by x).
  • WithArea — fills the region under each series' points.

Constructors

fromSeries : List Series -> ScatterChart

Create a scatter chart from multiple named series.

fromData : List ( Float, Float ) -> ScatterChart

Create a single-series scatter chart from (x, y) pairs.

Modifiers

Set chart width in pixels. Default: 500.

Set chart height in pixels. Default: 300.

Set the x-axis label.

Set the y-axis label.

Set the chart title.

Set the radius of scatter points in pixels. Default: 5.

Add a line or area overlay connecting each series' points. Default: NoOverlay.

-- Scatter + connecting line (sorted by x):
Scatter.fromSeries series
    |> Scatter.withOverlay Scatter.WithLine
    |> Scatter.toSvg


-- Scatter + filled area:
Scatter.fromSeries series
    |> Scatter.withOverlay Scatter.WithArea
    |> Scatter.toSvg

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

Enable SVG <title> tooltips on each point. Default: False.

When enabled, hovering over a scatter point shows a browser-native tooltip with the x and y coordinates (e.g. "(3.5, 72.0)"). No ports or state required.

Renderer

toSvg : ScatterChart -> Html msg

Render to Html msg.