Chart

Server-rendered bar or line marks that follow the theme tokens, with a text and data alternative.

Two fixed series rendered as SVG, with the same values in a native data table.

Open in new tab

Each preview is its own Live page in a frame, because this site is a Vue 3.5 app built on the Pulsar starter kit. An open list or popover stays inside its frame; in your application it opens over the page.

Installation

bash
suprnova live:add chart

Usage

html
{% import "suprnova-ui/chart/chart.html" as chart %}
{% call chart::chart("traffic", "Monthly traffic", self.chart_svg()?, "Traffic increased in June.") %}<table><caption>Monthly traffic</caption></table>{% endcall %}

Examples

Line chart

Two latency series show token-colored lines and a textual data alternative.

Open in new tab

Keyboard and accessibility

suprnova.chart - server-rendered SVG with its data beside it (DATA-004). The island renders the marks through charts-rs and passes them as trusted markup; the figure carries a text summary and a data table in a disclosure, so the canonical document reads without the picture. The island exposes `pub mod filters { pub use suprnova::view::filters::trusted_html; }`. The SVG has a transparent background and no color or font of its own (DATA-007): its text, axis, grid and series carry classes that chart.css colors from `--sn-` tokens, series taking --sn-color-chart-1 to -6 in order and starting again at the seventh, and its text takes the `--sn-font-sans` font chart.css sets on the figure.

API reference

chart

ParameterDefaultDescription
idRequiredThe unique figure id, also used for its title.
titleRequiredThe figure caption naming the chart.
svgRequiredTrusted SVG from suprnova::live::charts::render_chart; roles take colors from the theme tokens.
summaryRequiredA text summary that explains the chart without its picture.