mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Merge pull request #2338 from DaanDeMeyer/documentation-fixes
Documentation fixes
This commit is contained in:
commit
795f154c39
@ -145,13 +145,13 @@ position | String | 'top' | Position of the legend. Options are 'top' or 'bottom
|
||||
fullWidth | Boolean | true | Marks that this box should take the full width of the canvas (pushing down other boxes)
|
||||
onClick | Function | `function(event, legendItem) {}` | A callback that is called when a click is registered on top of a label item
|
||||
labels |-|-|-
|
||||
*labels*boxWidth | Number | 40 | Width of coloured box
|
||||
*labels*fontSize | Number | 12 | Font size
|
||||
*labels*fontStyle | String | "normal" |
|
||||
*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*.boxWidth | Number | 40 | Width of coloured box
|
||||
*labels*.fontSize | Number | 12 | Font size
|
||||
*labels*.fontStyle | String | "normal" |
|
||||
*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.
|
||||
|
||||
The global options for tooltips are defined in `Chart.defaults.global.tooltips`.
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ Pie and doughnut charts are probably the most commonly used chart there are. The
|
||||
|
||||
They are excellent at showing the relational proportions between data.
|
||||
|
||||
Pie and doughnut charts are effectively the same class in Chart.js, but have one different default value - their `percentageInnerCutout`. This equates what percentage of the inner should be cut out. This defaults to `0` for pie charts, and `50` for doughnuts.
|
||||
Pie and doughnut charts are effectively the same class in Chart.js, but have one different default value - their `cutoutPercentage`. This equates what percentage of the inner should be cut out. This defaults to `0` for pie charts, and `50` for doughnuts.
|
||||
|
||||
They are also registered under two aliases in the `Chart` core. Other than their different default value, and different alias, they are exactly the same.
|
||||
|
||||
@ -100,4 +100,4 @@ new Chart(ctx,{
|
||||
// and the Doughnut chart defaults but this particular instance will have `animateScale` set to `true`.
|
||||
```
|
||||
|
||||
We can also change these default values for each Doughnut type that is created, this object is available at `Chart.defaults.doughnut`. Pie charts also have a clone of these defaults available to change at `Chart.defaults.pie`, with the only difference being `percentageInnerCutout` being set to 0.
|
||||
We can also change these default values for each Doughnut type that is created, this object is available at `Chart.defaults.doughnut`. Pie charts also have a clone of these defaults available to change at `Chart.defaults.pie`, with the only difference being `cutoutPercentage` being set to 0.
|
||||
Loading…
x
Reference in New Issue
Block a user