Hide labels when the user returns null from the userCallback. This is the same as the category scale

This commit is contained in:
Evert Timberg 2015-09-14 20:34:49 -04:00
parent c1f0a39982
commit eb657bce36

View File

@ -453,6 +453,11 @@
// Grid lines are vertical // Grid lines are vertical
var xValue = this.getPixelForValue(tick); 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)) { if (tick === 0 || (!hasZero && index === 0)) {
// Draw the 0 point specially or the left if there is no 0 // Draw the 0 point specially or the left if there is no 0
this.ctx.lineWidth = this.options.gridLines.zeroLineWidth; this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;