margin

Specifies the distance between the legend and surrounding widget elements or container borders in pixels.

Type: Number|Object
Default Value: 10

When this option is set to a number, the specified margin applies to all the sides of the legend. Alternatively, the margin option can be set to an object. This object specifies margins for each side of the legend separately.

Whether or not the specified margin is applied to a particular side of the legend depends on the legend's location. The location is determined by the horizontalAlignment and verticalAlignment options. Refer to the top, bottom, left and right options' description to discover when the margin applies to the corresponding side of the legend.

PolarChartMargin ChartJS

bottom

Specifies the legend's bottom margin in pixels.

Type: Number
Default Value: 10

Applies when verticalAlignment is 'bottom' or horizontalAlignment is 'center'.

left

Specifies the legend's left margin in pixels.

Type: Number
Default Value: 10

Applies when horizontalAlignment is 'left'.

right

Specifies the legend's right margin in pixels.

Type: Number
Default Value: 10

Applies when horizontalAlignment is 'right'.

top

Specifies the legend's bottom margin in pixels.

Type: Number
Default Value: 10

Applies when verticalAlignment is 'top' or horizontalAlignment is 'center'.