UI Docs Deploy now

Line chart

A value over time. Press anywhere to read a point.

Styles: components/item.css, components/card.css, components/chart.css.
Needs moin.js: chart.

CPU

Network

Code
<div class="moin-grid">
  <section class="moin-card">
    <div class="moin-card-head">
      <h2 class="moin-heading">CPU</h2>
    </div>
    <moin-chart><script type="application/json">{"lines":[{"values":[30.0,35.9,41.2,45.2,47.6,48.4,47.7,45.9,43.7,41.7,40.3,40.0,40.8,42.5,44.8,47.0,48.6,48.9,47.7,44.8,40.4,34.9,28.9,23.1,18.1,14.6,12.6,12.3,13.3,15.2,17.3,19.0,20.0,19.8,18.6,16.5,14.1,11.9,10.6,10.7,12.4,15.7,20.5,26.3,32.3,37.9,42.4,45.5,47.0,46.9,45.6,43.7,41.8,40.3,39.9,40.5,42.2,44.5,47.0,49.1,50.1,49.6,47.4,43.6,38.5,32.6,26.7,21.3,17.2,14.6,13.6,14.0,15.5,17.4,19.1,20.1,20.2,19.1,17.0,14.4,11.9,10.0,9.3,10.3,13.0,17.2,22.6,28.5,34.4,39.4,43.1,45.2,45.8,45.0,43.4,41.6]}],"unit":"%","top":100,"times":["09:00","09:15","09:30","09:45","10:01","10:16","10:31","10:46","11:01","11:16","11:32","11:47","12:02","12:17","12:32","12:47","13:03","13:18","13:33","13:48","14:03","14:18","14:33","14:49","15:04","15:19","15:34","15:49","16:04","16:20","16:35","16:50","17:05","17:20","17:35","17:51","18:06","18:21","18:36","18:51","19:06","19:21","19:37","19:52","20:07","20:22","20:37","20:52","21:08","21:23","21:38","21:53","22:08","22:23","22:39","22:54","23:09","23:24","23:39","23:54","00:09","00:25","00:40","00:55","01:10","01:25","01:40","01:56","02:11","02:26","02:41","02:56","03:11","03:27","03:42","03:57","04:12","04:27","04:42","04:57","05:13","05:28","05:43","05:58","06:13","06:28","06:44","06:59","07:14","07:29","07:44","07:59","08:15","08:30","08:45","09:00"],"ticks":["09:00","21:00","09:00"]}</script></moin-chart>
  </section>
  <section class="moin-card">
    <div class="moin-card-head">
      <h2 class="moin-heading">Network</h2>
    </div>
    <moin-chart><script type="application/json">{"lines":[{"label":"In","values":[30.0,35.9,41.2,45.2,47.6,48.4,47.7,45.9,43.7,41.7,40.3,40.0,40.8,42.5,44.8,47.0,48.6,48.9,47.7,44.8,40.4,34.9,28.9,23.1,18.1,14.6,12.6,12.3,13.3,15.2,17.3,19.0,20.0,19.8,18.6,16.5,14.1,11.9,10.6,10.7,12.4,15.7,20.5,26.3,32.3,37.9,42.4,45.5,47.0,46.9,45.6,43.7,41.8,40.3,39.9,40.5,42.2,44.5,47.0,49.1,50.1,49.6,47.4,43.6,38.5,32.6,26.7,21.3,17.2,14.6,13.6,14.0,15.5,17.4,19.1,20.1,20.2,19.1,17.0,14.4,11.9,10.0,9.3,10.3,13.0,17.2,22.6,28.5,34.4,39.4,43.1,45.2,45.8,45.0,43.4,41.6]},{"label":"Out","values":[19.0,20.8,21.9,22.2,21.8,20.7,19.2,17.5,16.0,14.9,14.5,14.9,16.0,17.7,19.8,21.8,23.5,24.6,24.7,23.9,22.2,19.6,16.6,13.4,10.5,8.0,6.3,5.5,5.5,6.2,7.4,8.9,10.4,11.6,12.5,13.0,13.1,12.9,12.5,12.2,12.0,12.1,12.4,13.0,13.7,14.6,15.4,16.2,16.8,17.4,17.9,18.5,19.1,20.0,20.9,22.0,23.0,23.8,24.2,24.1,23.3,21.9,19.8,17.3,14.7,12.1,9.9,8.3,7.6,7.7,8.6,10.1,11.8,13.6,14.9,15.7,15.6,14.8,13.3,11.3,9.1,7.2,5.8,5.1,5.5,6.7,8.8,11.5,14.5,17.4,20.0,21.9,23.2,23.7,23.5,22.7]}],"unit":" KB/s","times":["09:00","09:15","09:30","09:45","10:01","10:16","10:31","10:46","11:01","11:16","11:32","11:47","12:02","12:17","12:32","12:47","13:03","13:18","13:33","13:48","14:03","14:18","14:33","14:49","15:04","15:19","15:34","15:49","16:04","16:20","16:35","16:50","17:05","17:20","17:35","17:51","18:06","18:21","18:36","18:51","19:06","19:21","19:37","19:52","20:07","20:22","20:37","20:52","21:08","21:23","21:38","21:53","22:08","22:23","22:39","22:54","23:09","23:24","23:39","23:54","00:09","00:25","00:40","00:55","01:10","01:25","01:40","01:56","02:11","02:26","02:41","02:56","03:11","03:27","03:42","03:57","04:12","04:27","04:42","04:57","05:13","05:28","05:43","05:58","06:13","06:28","06:44","06:59","07:14","07:29","07:44","07:59","08:15","08:30","08:45","09:00"],"ticks":["09:00","21:00","09:00"]}</script></moin-chart>
  </section>
</div>

Data

Write the data as JSON in a script element inside <moin-chart>. lines is
all it needs; the rest is for what the data can’t say by itself.

Field What it is
lines One or two lines: label (shown with two lines) and values, one for each point; null is no value and breaks the line.
text In a line: the words for each value. Without it, the number and unit.
unit Comes after each number when there is no text.
top The top of the scale. Without it, a little over the highest value.
scale The three words next to the scale: top, middle, bottom. Without it, the numbers and unit.
times The words for each point, on top while the pointer is on it.
ticks The words under the plot.
at Where each point sits, as increasing numbers such as seconds. Without it, evenly spaced.
gap Breaks the lines where two points in at lie further apart than this.
marks Words at a point, by its index, drawn as a dot on the first line.

With a gap and a mark

CPU

Code
<section class="moin-card">
  <div class="moin-card-head">
    <h2 class="moin-heading">CPU</h2>
  </div>
  <moin-chart><script type="application/json">{"lines":[{"label":"CPU","values":[20,35,null,30,45,40],"text":["20%","35%","—","30%","45%","40%"]}],"at":[0,60,120,180,600,660],"gap":300,"top":100,"scale":["100%","50%","0%"],"times":["12:00","12:01","12:02","12:03","12:10","12:11"],"ticks":["12:00","12:03","12:11"],"marks":{"3":"v12 went live"}}</script></moin-chart>
</section>

This page as Markdown