Box-and-whisker plot — pure SVG, zero JS.
Renders statistical distributions as boxes (Q1-Q3), median lines, whiskers (to the most extreme non-outlier data points), and optional outlier dots. Supports both raw value lists and pre-computed quartile statistics.
Examples
<.box_plot data={[
%{label: "Group A", values: [12, 15, 18, 22, 25, 28, 30, 35, 45]},
%{label: "Group B", values: [5, 10, 15, 20, 25, 30, 35, 40]}
]} />
<.box_plot data={[
%{label: "Precomputed", q1: 15.0, median: 22.0, q3: 30.0,
whisker_low: 12.0, whisker_high: 35.0, outliers: [5.0, 45.0]}
]} />
Summary
Functions
Attributes
data(:list) - Raw values:[%{label, values: [numbers]}]or pre-computed:[%{label, q1, median, q3, whisker_low, whisker_high, outliers}]. Defaults to[].colors(:list) - Override default palette. CSS color strings. Defaults to[].show_outliers(:boolean) - Show outlier dots beyond whiskers. Defaults totrue.show_grid(:boolean) - Show Y-axis grid lines. Defaults totrue.show_labels(:boolean) - Show axis tick labels. Defaults totrue.animate(:boolean) - Enable entrance animations. Defaults totrue.animation_duration(:integer) - Animation duration in ms. Defaults to600.theme(:map) - Chart theme overrides (see ChartTheme). Defaults to%{}.id(:string) - Unique ID for the chart (auto-generated if not provided). Defaults tonil.title(:string) - Chart title rendered above the visualization. Defaults tonil.description(:string) - Chart description for context (rendered below title). Defaults tonil.class(:string) - Defaults tonil.- Global attributes are accepted.