diff --git a/src/core/core.layouts.js b/src/core/core.layouts.js index acb1b4ce2ec..7868eb67621 100644 --- a/src/core/core.layouts.js +++ b/src/core/core.layouts.js @@ -344,7 +344,7 @@ export default { // const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) => - wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0); + wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1; const params = Object.freeze({ outerWidth: width, diff --git a/test/fixtures/core.layouts/no-boxes-all-padding.js b/test/fixtures/core.layouts/no-boxes-all-padding.js new file mode 100644 index 00000000000..ae8500851be --- /dev/null +++ b/test/fixtures/core.layouts/no-boxes-all-padding.js @@ -0,0 +1,39 @@ +module.exports = { + config: { + type: 'line', + data: { + labels: [0], + datasets: [{ + data: [0], + radius: 16, + backgroundColor: 'red' + }], + }, + options: { + plugins: { + legend: false, + tooltip: false, + title: false, + filler: false + }, + scales: { + x: { + display: false, + offset: true + }, + y: { + display: false + } + }, + layout: { + padding: 16 + } + } + }, + options: { + canvas: { + height: 32, + width: 32 + } + } +}; diff --git a/test/fixtures/core.layouts/no-boxes-all-padding.png b/test/fixtures/core.layouts/no-boxes-all-padding.png new file mode 100644 index 00000000000..6bade811f6d Binary files /dev/null and b/test/fixtures/core.layouts/no-boxes-all-padding.png differ