]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Hide labels when the user returns null from the userCallback. This is the same as... 1456/head
authorEvert Timberg <evert.timberg@gmail.com>
Tue, 15 Sep 2015 00:34:49 +0000 (20:34 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Tue, 15 Sep 2015 00:34:49 +0000 (20:34 -0400)
src/scales/scale.logarithmic.js

index a8d9706b937afbe6c3859846f12f94e091421d43..7d0f181c99db701435a8ec4230340369b593e1a1 100644 (file)
                                                        // 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;