]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update legend docs -> parameter 'data' has changed to 'chart'. 2468/head
authorDarren Keane <darren.m.keane@students.ittralee.ie>
Thu, 5 May 2016 15:57:50 +0000 (16:57 +0100)
committerDarren Keane <darren.m.keane@students.ittralee.ie>
Thu, 5 May 2016 15:59:44 +0000 (16:59 +0100)
docs/00-Getting-Started.md
docs/06-Pie-Doughnut-Chart.md

index 24ee0a5cbc97686f1ed7f6cd325e9bac300722f5..4f299d5916461f27200a7d700068d587f327c53a 100644 (file)
@@ -151,7 +151,7 @@ labels |Object|-|-
 *labels*.fontColor | Color | "#666" |
 *labels*.fontFamily | String | "Helvetica Neue" |
 *labels*.padding | Number | 10 | Padding between rows of colored boxes
-*labels*.generateLabels: | Function | `function(data) {  }` | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. Styles that can be returned are `fillStyle`, `strokeStyle`, `lineCap`, `lineDash`, `lineDashOffset`, `lineWidth`, `lineJoin`. Return a `hidden` attribute to indicate that the label refers to something that is not visible. A strikethrough style will be given to the text in this case.
+*labels*.generateLabels: | Function | `function(chart) {  }` | Generates legend items for each thing in the legend. Default implementation returns the text + styling for the color box. Styles that can be returned are `fillStyle`, `strokeStyle`, `lineCap`, `lineDash`, `lineDashOffset`, `lineWidth`, `lineJoin`. Return a `hidden` attribute to indicate that the label refers to something that is not visible. A strikethrough style will be given to the text in this case.
 
 The global options for tooltips are defined in `Chart.defaults.global.tooltips`.
 
index b96816cc9056763d657f4f2d95950a64a10bc24b..05487069b1921ef79695cd3a7cb60732e04f01f3 100644 (file)
@@ -92,7 +92,7 @@ rotation | Number | -0.5 * Math.PI | Starting angle to draw arcs from
 circumference | Number | 2 * Math.PI | Sweep to allow arcs to cover
 *animation*.animateRotate | Boolean |true | If true, will animate the rotation of the chart.
 *animation*.animateScale | Boolean | false | If true, will animate scaling the Doughnut from the centre.
-*legend*.*labels*.generateLabels | Function | `function(data) {} ` | Returns labels for each the legend
+*legend*.*labels*.generateLabels | Function | `function(chart) {} ` | Returns a label for each item to be displayed on the legend.
 *legend*.onClick | Function | function(event, legendItem) {} ` | Handles clicking an individual legend item
 
 You can override these for your `Chart` instance by passing a second argument into the `Doughnut` method as an object with the keys you want to override.