let i, ilen, layout;
for (i = 0, ilen = layouts.length; i < ilen; ++i) {
layout = layouts[i];
- // store width used instead of chartArea.w in fitBoxes
- layout.width = layout.horizontal
- ? layout.box.fullWidth && params.availableWidth
- : params.vBoxMaxWidth;
- // store height used instead of chartArea.h in fitBoxes
- layout.height = layout.horizontal && params.hBoxMaxHeight;
+ // store dimensions used instead of available chartArea in fitBoxes
+ if (layout.horizontal) {
+ layout.width = layout.box.fullWidth && params.availableWidth;
+ layout.height = params.hBoxMaxHeight;
+ } else {
+ layout.width = params.vBoxMaxWidth;
+ layout.height = layout.box.fullWidth && params.availableHeight;
+ }
}
}
} else {
box.left = x;
box.right = x + box.width;
- box.top = chartArea.top;
- box.bottom = chartArea.top + chartArea.h;
+ box.top = box.fullWidth ? userPadding.top : chartArea.top;
+ box.bottom = box.fullWidth ? params.outerHeight - userPadding.right : chartArea.top + chartArea.h;
box.height = box.bottom - box.top;
x = box.right;
}
outerHeight: height,
padding,
availableWidth,
+ availableHeight,
vBoxMaxWidth: availableWidth / 2 / verticalBoxes.length,
hBoxMaxHeight: availableHeight / 2
});