From: Evert Timberg Date: Tue, 15 Sep 2015 00:34:49 +0000 (-0400) Subject: Hide labels when the user returns null from the userCallback. This is the same as... X-Git-Tag: 2.0.0-alpha4~28^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1456%2Fhead;p=thirdparty%2FChart.js.git Hide labels when the user returns null from the userCallback. This is the same as the category scale --- 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;