From 02340cad8b7f2856a052527d81ff4eaf75e107db Mon Sep 17 00:00:00 2001 From: bordun Date: Mon, 23 Dec 2019 13:20:34 +0100 Subject: [PATCH] plot: fix origin property ignore when == 0 --- src/client/app/widgets/plots/_plots_base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/app/widgets/plots/_plots_base.js b/src/client/app/widgets/plots/_plots_base.js index 9871818f..8d0ee10f 100644 --- a/src/client/app/widgets/plots/_plots_base.js +++ b/src/client/app/widgets/plots/_plots_base.js @@ -117,7 +117,7 @@ module.exports = class _plots_base extends Canvas { if (this.getProp('origin') !== false) { - var origin = mapToScale(this.getProp('origin') || this.rangeY.min,[this.rangeY.min,this.rangeY.max],[this.height,0],0,this.getProp('logScaleY'),true) + var origin = mapToScale(this.getProp('origin'), [this.rangeY.min,this.rangeY.max],[this.height,0],0,this.getProp('logScaleY'),true) this.ctx.globalAlpha = 0.1 this.ctx.fillStyle = this.colors.custom @@ -152,7 +152,7 @@ module.exports = class _plots_base extends Canvas { var barWidth = Math.round(this.width / this.value.length), offset = Math.round((this.width - barWidth * this.value.length) / 2) - var origin = mapToScale(this.getProp('origin') || this.rangeY.min,[this.rangeY.min,this.rangeY.max],[this.height,0],0,this.getProp('logScaleY'),true) + var origin = mapToScale(this.getProp('origin') !== false ? this.getProp('origin') : this.rangeY.min, [this.rangeY.min,this.rangeY.max],[this.height,0],0,this.getProp('logScaleY'),true) this.ctx.beginPath()