hello,
I've been using smoothie chart for an HMI and i'm using static charts to display parameters
it wasn't working properly with responsive:true since this.canvas didn't have the canvas object
To fix this i added if(!this.canvas){this.canvas = canvas;} in SmoothieChart.prototype.render like so
=================================================================
SmoothieChart.prototype.render = function(canvas, time) {
var nowMillis = Date.now();
// Respect any frame rate limit.
if (this.options.limitFPS > 0 && nowMillis - this.lastRenderTimeMillis < (1000/this.options.limitFPS))
return;
if (!this.isAnimatingScale) {
// We're not animating. We can use the last render time and the scroll speed to work out whether
// we actually need to paint anything yet. If not, we can return immediately.
// Render at least every 1/6th of a second. The canvas may be resized, which there is
// no reliable way to detect.
var maxIdleMillis = Math.min(1000/6, this.options.millisPerPixel);
if (nowMillis - this.lastRenderTimeMillis < maxIdleMillis) {
return;
}
}
if(!this.canvas){this.canvas = canvas;}
this.resize();
this.updateTooltip();
=================================================================
is there a proper way to do it ?
thanks for the awsome library
Have a nice day