Chart
A pure-SVG multi-series chart supporting line, bar, and area types with no external dependencies.
Preview
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
type | string | line | Chart type: "line", "bar", or "area" |
data | string | — | JSON series payload: array of numbers or array of {label,values} objects |
width | number | 480 | Chart width in px |
height | number | 240 | Chart height in px |
smooth | boolean | — | Curved line/area paths |
labels | string | — | Comma list of x-axis tick labels |
Installation
pura is copy-paste and dependency-free. Load the whole library, or just this component.
<link rel="stylesheet" href="/pura/tokens.css">
<script type="module" src="/pura/lib/chart.js"></script> import "./pura/lib/chart.js";