From: Pratyush Mittal Date: Sat, 8 Aug 2015 08:37:24 +0000 (+0530) Subject: Added documentation for maxRotation of labels X-Git-Tag: 2.0.0-alpha4~52^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1365%2Fhead;p=thirdparty%2FChart.js.git Added documentation for maxRotation of labels --- diff --git a/docs/00-Getting-Started.md b/docs/00-Getting-Started.md index a678a46d6..9b372c825 100644 --- a/docs/00-Getting-Started.md +++ b/docs/00-Getting-Started.md @@ -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 } } } -``` \ No newline at end of file +```