From ca0ece37e6a7f706ff918a12fc5849c9cf6cb980 Mon Sep 17 00:00:00 2001 From: Pratyush Mittal Date: Sat, 8 Aug 2015 14:07:24 +0530 Subject: [PATCH] Added documentation for maxRotation of labels --- docs/00-Getting-Started.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 +``` -- 2.47.2