 this.canvas = canvas;
    this.delay = delayMillis;
    this.start();
  };

  /**
   * Make sure the canvas has the optimal resolution for the device's pixel ratio.
   */
  SmoothieChart.prototype.resize = function() {
    // TODO this function doesn't handle the value of enableDpiScaling changing during execution
    if (!this.options.enableDpiScaling || !window || window.devicePixelRatio === 1)
      return;

    var dpr = window.devicePixelRatio;
    var width = parseInt(this.canvas.getAttribute('width'