plots: parse numeric values for smooth option; round number of point to make sure the whole line gets drawn

This commit is contained in:
bordun 2017-09-15 22:35:46 +02:00
parent 12fc23798a
commit a4240b8bb2

View file

@ -29,6 +29,7 @@ module.exports = class _plots_base extends _canvas_base {
max: Math.abs(this.rangeY.max)>=1000?this.rangeY.max/1000+'k':this.rangeY.max
}
}
this.smooth = this.getProp('smooth') === true ? 0.25 : this.getProp('smooth') === false ? 0 : parseFloat(this.getProp('smooth')) || 0
@ -147,7 +148,7 @@ module.exports = class _plots_base extends _canvas_base {
}
this.ctx.curve(points, this.getProp('smooth') ? 0.25 : 0, this.width/(points.length/2 - 1))
this.ctx.curve(points, this.smooth, Math.round(this.width/(points.length/2 - 1)))