src/cal-heatmap.js
function autoAddLegendMargin() {
			switch(options.legendVerticalPosition) {
			case "top":
				options.legendMargin[2] = parent.DEFAULT_LEGEND_MARGIN;
				break;
			case "bottom":
				options.legendMargin[0] = parent.DEFAULT_LEGEND_MARGIN;
				break;
			case "middle":
			case "center":
				options.legendMargin[options.legendHorizontalPosition === "right" ? 3 : 1] = parent.DEFAULT_LEGEND_MARGIN;
			}
		}
function autoAddLegendMargin() {
			switch(options.legendVerticalPosition) {
			case "top":
				options.legendMargin[2] = parent.DEFAULT_LEGEND_MARGIN;
				break;
			case "bottom":
				options.legendMargin[0] = parent.DEFAULT_LEGEND_MARGIN;
				break;
			case "middle":
			case "center":
				options.legendMargin[options.legendHorizontalPosition === "right" ? 3 : 1] = parent.DEFAULT_LEGEND_MARGIN;
			}
		}
function autoAddLegendMargin ( ) { switch ( options . legendVerticalPosition ) { case "top" : options . legendMargin [ 2 ] = parent . DEFAULT_LEGEND_MARGIN ; break ; case "bottom" : options . legendMargin [ 0 ] = parent . DEFAULT_LEGEND_MARGIN ; break ; case "middle" : case "center" : options . legendMargin [ options . legendHorizontalPosition === "right" ? 3 : 1 ] = parent . DEFAULT_LEGEND_MARGIN ; } }
If not specified, add some margin around the legend depending on its position

@return void
If not specified add some margin around the legend depending on its position