When this option is set to a number, the specified margin applies to all 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.
Applies when horizontalAlignment is 'left'.
Applies when horizontalAlignment is 'right'.