vendor/chart.js/Chart.js
function fitBox(box) {
			var minBoxSize = helpers$1.findNextWhere(minBoxSizes, function(minBox) {
				return minBox.box === box;
			});

			if (minBoxSize) {
				if (minBoxSize.horizontal) {
					var scaleMargin = {
						left: Math.max(outerBoxSizes.left, maxPadding.left),
						right: Math.max(outerBoxSizes.right, maxPadding.right),
						top: 0,
						bottom: 0
					};

					// Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends
					// on the margin. Sometimes they need to increase in size slightly
					box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);
				} else {
					box.update(minBoxSize.width, maxChartAreaHeight);
				}
			}
		}
function fitBox(box) {
			var minBoxSize = helpers$1.findNextWhere(minBoxSizes, function(minBox) {
				return minBox.box === box;
			});

			if (minBoxSize) {
				if (minBoxSize.horizontal) {
					var scaleMargin = {
						left: Math.max(outerBoxSizes.left, maxPadding.left),
						right: Math.max(outerBoxSizes.right, maxPadding.right),
						top: 0,
						bottom: 0
					};

					// Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends
					// on the margin. Sometimes they need to increase in size slightly
					box.update(box.fullWidth ? chartWidth : maxChartAreaWidth, chartHeight / 2, scaleMargin);
				} else {
					box.update(minBoxSize.width, maxChartAreaHeight);
				}
			}
		}
function fitBox ( box ) { var minBoxSize = helpers$1 . findNextWhere ( minBoxSizes , function ( minBox ) { return minBox . box === box ; } ) ; if ( minBoxSize ) { if ( minBoxSize . horizontal ) { var scaleMargin = { left : Math . max ( outerBoxSizes . left , maxPadding . left ) , right : Math . max ( outerBoxSizes . right , maxPadding . right ) , top : 0 , bottom : 0 } ; // Don't use min size here because of label rotation. When the labels are rotated, their rotation highly depends // on the margin. Sometimes they need to increase in size slightly box . update ( box . fullWidth ? chartWidth : maxChartAreaWidth , chartHeight / 2 , scaleMargin ) ; } else { box . update ( minBoxSize . width , maxChartAreaHeight ) ; } } }
At this point, maxChartAreaHeight and maxChartAreaWidth are the size the chart area could be if the axes are drawn at their minimum sizes. Steps 5 & 6 Function to fit a box
At this point maxChartAreaHeight and maxChartAreaWidth are the size the chart area could be if the axes are drawn at their minimum sizes . Steps 5 & 6 Function to fit a box