Added documentation for maxRotation of labels

This commit is contained in:
Pratyush Mittal 2015-08-08 14:07:24 +05:30
parent f5b44acc38
commit ca0ece37e6

View File

@ -371,6 +371,9 @@ the following options.
// Number - controls the padding between the label and the axis
padding: 10,
// Number: maximum auto-rotation allowed for labels.
maxRotation: 90,
// String - template string for labels
template: "<%=value%>",
@ -393,14 +396,15 @@ the following options.
```
The `userCallback` method may be useful when there are a lot of labels. The following callback would filter out every second label on a category scale
The `userCallback` method may be useful when there are a lot of labels. The following callback would show every fifth label on a category scale
```javascript
{
scales: {
xAxes: [{
labels: {
maxRotation: 0, // set maxRotation to 0 to turn off auto-rotation
userCallback: function(labelString, index) {
return (index % 2 === 0) ? labelString : '';
return (index % 5 === 0) ? labelString : '';
}
}
}]
@ -490,4 +494,4 @@ The `userCallback` function allows the user fine grained control over how labels
}
}
}
```
```