Wynn Netherland changelog.com/posts

smoothie: Lightweight JavaScript library for smooth real-time charts in the browser

Providing real-time, smoothly updating charts in the browser is a challenge. London-based developer Joe Walnes has tackled the problem with Smoothie Charts, a lightweight JavaScript library that uses <canvas> to do just that.


A quick example from the project homepage:

// Randomly add a data point every 500ms
var random = new TimeSeries();
setInterval(function() {
  random.append(new Date().getTime(), Math.random() * 10000);
}, 500);

function createTimeline() {
  var chart = new SmoothieChart();
  chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 });
  chart.streamTo(document.getElementById("chart"), 500);

[Source on GitHub] [Homepage]


Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00