2017-03-21 01:36:54 +01:00
# Layout Configuration
2020-01-03 20:07:38 +01:00
The layout configuration is passed into the `options.layout` namespace. The global options for the chart layout is defined in `Chart.defaults.layout` .
2017-03-21 01:36:54 +01:00
| Name | Type | Default | Description
2019-01-29 13:34:16 +01:00
| ---- | ---- | ------- | -----------
| `padding` | < code > number| object</ code > | `0` | The padding to add inside the chart. [more... ](#padding )
2017-03-21 01:36:54 +01:00
## Padding
2019-01-29 13:34:16 +01:00
If this value is a number, it is applied to all sides of the chart (left, top, right, bottom). If this value is an object, the `left` property defines the left padding. Similarly the `right` , `top` and `bottom` properties can also be specified.
2017-03-21 01:36:54 +01:00
Lets say you wanted to add 50px of padding to the left side of the chart canvas, you would do:
```javascript
let chart = new Chart(ctx, {
type: 'line',
data: data,
options: {
layout: {
padding: {
left: 50,
right: 0,
top: 0,
bottom: 0
}
}
}
});
2019-01-29 13:34:16 +01:00
```