From fa62d96456731fec3f1450ac9f0c64a23fcae44e Mon Sep 17 00:00:00 2001 From: migwi Date: Tue, 14 May 2019 03:10:58 +0300 Subject: [PATCH] Drop the red columns that have a value of zero --- public/js/helpers/chart_helper.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/js/helpers/chart_helper.js b/public/js/helpers/chart_helper.js index 452fcb1e5..1e877c3d6 100644 --- a/public/js/helpers/chart_helper.js +++ b/public/js/helpers/chart_helper.js @@ -30,6 +30,7 @@ function plotChart (e, barWidth) { ctx.fillStyle = e.color e.points.map((p) => { + if (p.yval === 0) return var x = p.canvasx - barWidth / 2 var height = yBottom - p.canvasy ctx.fillRect(x, p.canvasy, barWidth, height) @@ -56,6 +57,7 @@ export function multiColumnBarPlotter (e) { ctx.strokeStyle = strokeColors[i] bar.map((p) => { + if (p.yval === 0) return var xLeft = p.canvasx - (barWidth / 2) * (1 - i / (sets.length - 1)) var height = yBottom - p.canvasy var width = barWidth / sets.length