stockiNail f16e836c3d
Add color options to documentation and types where missing (#8196)
* fixes #8188 and #8189

* removes scriptable context sample with link to options page

* Removes <code> tags in markdown where not needed
2020-12-18 22:03:01 +02:00

1.0 KiB

title
Layout

The layout configuration is passed into the options.layout namespace. The global options for the chart layout is defined in Chart.defaults.layout.

Name Type Default Scriptable Description
padding number|object 0 Yes The padding to add inside the chart. more...

Padding

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.

Lets say you wanted to add 50px of padding to the left side of the chart canvas, you would do:

let chart = new Chart(ctx, {
    type: 'line',
    data: data,
    options: {
        layout: {
            padding: {
                left: 50,
                right: 0,
                top: 0,
                bottom: 0
            }
        }
    }
});