# `LedgerUI.Components.Sparkline`
[🔗](https://github.com/devaction-labs/ledger_ui/blob/v0.2.0/lib/ledger_ui/components/sparkline.ex#L1)

The canvas's sparkline (`lu-spark`): a line with a soft fill under it, drawn on the server from a
list of numbers (the highest at the top), so it renders without JavaScript.

    <.sparkline id="bb" values={[8, 12, 9, 14, 11, 16]} />
    <.sparkline id="itau" values={@balances} color="primary" />

`color="primary"` draws it in the accent, `neutral` (default) in the ink. The SVG stretches to
the width of its box (`preserveAspectRatio="none"`); the box gets its size from `class`/`style`.
`id` names the gradient of the fill and must be unique on the page.

# `sparkline`

## Attributes

* `id` (`:string`) (required) - Names the gradient of the fill, so it must be unique.
* `values` (`:list`) (required) - Numbers for the line.
* `color` (`:string`) - Defaults to `"neutral"`. Must be one of `"neutral"`, or `"primary"`.
* `class` (`:any`) - Defaults to `nil`.
* Global attributes are accepted.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
