Line chart
How one or more values change across ordered categories, usually time.
| Name | Type | What it does |
|---|---|---|
lineChart(data, options) | component | data: { labels, series: [{ name, values }] } |
{ times, series } | modifier | Data: give a date, ISO string or millisecond number per value instead of labels for a real time axis. Points sit where their time falls, so gaps in the data show as gaps. Ticks are in UTC |
{ smooth: true } | modifier | Option: draw curves that pass through every point without overshooting |
{ zero: true } | modifier | Option: start the y axis at zero instead of fitting it to the data |
{ width, height } | modifier | Option: the drawing's proportions. It always scales to the width of its container |
{ label } | modifier | Option: a description read out by screen readers |
Two series
<script type="module" src="node_modules/glimmer-ui/charts.js"></script>
<gl-chart type="line" data='{"labels":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"],"series":[{"name":"Visits","values":[120,180,160,240,300,280,360,420]},{"name":"Sign-ups","values":[40,60,90,80,140,170,160,230]}]}'></gl-chart>Smooth
<script type="module" src="node_modules/glimmer-ui/charts.js"></script>
<gl-chart type="line" data='{"labels":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"],"series":[{"name":"Visits","values":[120,180,160,240,300,280,360,420]},{"name":"Sign-ups","values":[40,60,90,80,140,170,160,230]}]}' options='{"smooth":true}'></gl-chart>Over time, with a gap in the data
<script type="module" src="node_modules/glimmer-ui/charts.js"></script>
<gl-chart type="line" zoom data='{"times":["2026-07-01","2026-07-02","2026-07-03","2026-07-04","2026-07-05","2026-07-06","2026-07-07","2026-07-08","2026-07-09","2026-07-10","2026-07-11","2026-07-12","2026-07-13","2026-07-14","2026-07-15","2026-07-16","2026-07-17","2026-07-18","2026-07-19","2026-07-20","2026-07-21","2026-07-22","2026-07-23","2026-07-24","2026-07-25","2026-07-26","2026-07-27","2026-07-28","2026-07-29","2026-07-30","2026-07-31","2026-08-01","2026-08-02","2026-08-03","2026-08-04","2026-08-05","2026-08-06","2026-08-07","2026-08-08","2026-08-09","2026-08-24","2026-08-25","2026-08-26","2026-08-27","2026-08-28","2026-08-29","2026-08-30","2026-08-31","2026-09-01","2026-09-02","2026-09-03","2026-09-04","2026-09-05","2026-09-06","2026-09-07","2026-09-08","2026-09-09","2026-09-10","2026-09-11","2026-09-12","2026-09-13","2026-09-14","2026-09-15","2026-09-16","2026-09-17","2026-09-18","2026-09-19","2026-09-20","2026-09-21","2026-09-22","2026-09-23","2026-09-24","2026-09-25","2026-09-26","2026-09-27","2026-09-28"],"series":[{"name":"Reading","values":[53.1,52.6,54.7,53.8,53.4,54.6,56.7,58.1,55.7,56.6,58.6,57.9,59.9,57.7,59.3,60.3,57.6,60.5,60.3,62.9,64.8,65.4,64.3,65,65.9,66.4,66.7,65.7,64.1,65.8,65.7,63.9,61.2,59.3,61.7,63.9,62.7,60.3,57.6,59.1,58.1,55.5,54.4,52.1,50,47.5,47,44.9,47.4,46.9,47.1,48.1,47.3,44.5,41.9,42.1,40.1,41.3,38.7,41.3,40.4,39.5,40.3,43,42.1,44.3,47.4,49,52,50.9,52.1,50.2,53.3,54.2,55.7,54.7]}]}' options='{"smooth":true}'></gl-chart>