xAxes: [{
labels: {
maxRotation: 0, // set maxRotation to 0 to turn off auto-rotation
+
+ // Return an empty string to draw the grid line but hide the label
+ // Return `null` or `undefined` to hide the grid line
userCallback: function(labelString, index) {
return (index % 5 === 0) ? labelString : '';
}
display: true,
labels: {
userCallback: function(dataLabel, index) {
- return index % 2 === 0 ? dataLabel : '';
+ return index % 2 === 0 ? dataLabel : null;
}
}
}],
}
helpers.each(this.labels, function(label, index) {
- if (skipRatio > 1 && index % skipRatio > 0) {
+ // Blank labels
+ if ((skipRatio > 1 && index % skipRatio > 0) || (label === undefined || label === null)) {
return;
}
var xLineValue = this.getPixelForValue(label, index, null, false); // xvalues for grid lines