From eb657bce36f470d632c95072f0a0bcdafb4933f8 Mon Sep 17 00:00:00 2001 From: Evert Timberg Date: Mon, 14 Sep 2015 20:34:49 -0400 Subject: [PATCH] Hide labels when the user returns null from the userCallback. This is the same as the category scale --- src/scales/scale.logarithmic.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scales/scale.logarithmic.js b/src/scales/scale.logarithmic.js index a8d9706b9..7d0f181c9 100644 --- a/src/scales/scale.logarithmic.js +++ b/src/scales/scale.logarithmic.js @@ -453,6 +453,11 @@ // Grid lines are vertical var xValue = this.getPixelForValue(tick); + if (this.labels[index] === null) { + // If the user specifically hid the label by returning null from the label function, do so + return; + } + if (tick === 0 || (!hasZero && index === 0)) { // Draw the 0 point specially or the left if there is no 0 this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;