Charts overview
Fifteen chart types, from line and bar to candlesticks, RSI, MACD and chord diagrams, drawn as SVG by small dependency-free functions and styled by the kit, so they pick up your colours and glow like everything else.
| Name | Type | What it does |
|---|---|---|
<gl-chart type data options> | component | A tag for plain HTML. Load charts.js once as a module and it draws itself at its own width, so text stays the same size on a phone |
<gl-chart zoom> | modifier | Attribute: charts over labels, times or candles zoom (pinch, Ctrl + wheel, + and −), pan (drag, Shift + arrows) and reset (double-click, 0) |
<Chart type data options zoom /> | component | The React component, from glimmer-ui/react. Drawn on the server, interactive in the browser |
chart(type, data, options) | component | The same thing as a function that returns an SVG string. Works on a server or in the browser |
chart | component | The class on every chart's <svg>, if you want to style them yourself |
--chart-1 … --chart-8 | modifier | CSS variables: the series colours. The first five are the accent tokens, the rest are blends |
{ window: [start, end] } | modifier | Option: draw only that slice of the data. This is what zooming sets; indicators are still worked out from all of it |
In <gl-chart>, charts with axes show a crosshair with the values under the pointer; the arrow keys move it and Escape hides it. As a plain SVG string, every mark has a native tooltip instead. Put a chart in a card for a glass panel. On Apple platforms, use Swift Charts with .glimmerChartStyle(); the chord diagram is the one chart Glimmer draws itself there.
In plain HTML or JavaScript
<script type="module" src="node_modules/glimmer-ui/charts.js"></script>
<gl-chart type="bar" data='{"labels":["Q1","Q2","Q3","Q4"],"series":[{"name":"2025","values":[42,58,51,73]},{"name":"2026","values":[55,64,80,96]}]}'></gl-chart>