mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-14 04:06:49 +01:00
Category scale filter function will hide the grid line if null or undefined returned.
This commit is contained in:
@@ -403,6 +403,9 @@ The `userCallback` method may be useful when there are a lot of labels. The foll
|
||||
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 : '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user