Skip to content

Commit 5d94cac

Browse files
kurkleetimberg
authored andcommitted
Update documentation of order (#6897)
1 parent 03f65d4 commit 5d94cac

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

docs/charts/bar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ the color of the bars is generally set this way.
8888
| ---- | ----
8989
| `clip` | How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. `0` = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}`
9090
| `label` | The label for the dataset which appears in the legend and tooltips.
91-
| `order` | The drawing order of dataset. Also affects order for stacking, tooltip, and legend.
91+
| `order` | The drawing order of dataset. Also affects order for stacking, tooltip and legend.
9292
| `xAxisID` | The ID of the x axis to plot this dataset on.
9393
| `yAxisID` | The ID of the y axis to plot this dataset on.
9494

docs/charts/bubble.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The bubble chart allows a number of properties to be specified for each dataset.
6262
| ---- | ----
6363
| `clip` | How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. `0` = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}`
6464
| `label` | The label for the dataset which appears in the legend and tooltips.
65-
| `order` | The drawing order of dataset.
65+
| `order` | The drawing order of dataset. Also affects order for tooltip and legend.
6666

6767
### Styling
6868

docs/charts/line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ The line chart allows a number of properties to be specified for each dataset. T
8888
| ---- | ----
8989
| `clip` | How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. `0` = clip at chartArea. Clipping can also be configured per side: `clip: {left: 5, top: false, right: -2, bottom: 0}`
9090
| `label` | The label for the dataset which appears in the legend and tooltips.
91-
| `order` | The drawing order of dataset. Also affects order for stacking, tooltip, and legend.
91+
| `order` | The drawing order of dataset. Also affects order for stacking, tooltip and legend.
9292
| `xAxisID` | The ID of the x axis to plot this dataset on.
9393
| `yAxisID` | The ID of the y axis to plot this dataset on.
9494

docs/charts/mixed.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ At this point we have a chart rendering how we'd like. It's important to note th
7171

7272
## Drawing order
7373

74-
By default, datasets are drawn so that first one is top-most. This can be altered by specifying `order` option to datasets. `order` defaults to `0`.
74+
By default, datasets are drawn so that first one is top-most. This can be altered by specifying `order` option to datasets. `order` defaults to `0`. Note that this also affects stacking, legend and tooltip. So its essentially the same as reordering the datasets.
7575

7676
```javascript
7777
var mixedChart = new Chart(ctx, {
@@ -81,13 +81,13 @@ var mixedChart = new Chart(ctx, {
8181
label: 'Bar Dataset',
8282
data: [10, 20, 30, 40],
8383
// this dataset is drawn below
84-
order: 1
84+
order: 2
8585
}, {
8686
label: 'Line Dataset',
8787
data: [10, 10, 10, 10],
8888
type: 'line',
8989
// this dataset is drawn on top
90-
order: 2
90+
order: 1
9191
}],
9292
labels: ['January', 'February', 'March', 'April']
9393
},

docs/configuration/legend.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
The chart legend displays data about the datasets that are appearing on the chart.
44

55
## Configuration options
6+
67
The legend configuration is passed into the `options.legend` namespace. The global options for the chart legend is defined in `Chart.defaults.global.legend`.
78

89
| Name | Type | Default | Description
@@ -20,14 +21,18 @@ The legend configuration is passed into the `options.legend` namespace. The glob
2021
| `textDirection` | `string` | canvas' default | This will force the text direction `'rtl'|'ltr` on the canvas for rendering the legend, regardless of the css specified on the canvas
2122

2223
## Position
24+
2325
Position of the legend. Options are:
26+
2427
* `'top'`
2528
* `'left'`
2629
* `'bottom'`
2730
* `'right'`
2831

2932
## Align
33+
3034
Alignment of the legend. Options are:
35+
3136
* `'start'`
3237
* `'center'`
3338
* `'end'`
@@ -115,6 +120,7 @@ var chart = new Chart(ctx, {
115120
It can be common to want to trigger different behaviour when clicking an item in the legend. This can be easily achieved using a callback in the config object.
116121

117122
The default legend click handler is:
123+
118124
```javascript
119125
function(e, legendItem) {
120126
var index = legendItem.datasetIndex;

0 commit comments

Comments
 (0)