Skip to content

Commit 5ab5552

Browse files
authored
Fix layout bug when there are no visible boxes (#8507)
1 parent 692d8a4 commit 5ab5552

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

src/core/core.layouts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ export default {
344344
//
345345

346346
const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>
347-
wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0);
347+
wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;
348348

349349
const params = Object.freeze({
350350
outerWidth: width,
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
config: {
3+
type: 'line',
4+
data: {
5+
labels: [0],
6+
datasets: [{
7+
data: [0],
8+
radius: 16,
9+
backgroundColor: 'red'
10+
}],
11+
},
12+
options: {
13+
plugins: {
14+
legend: false,
15+
tooltip: false,
16+
title: false,
17+
filler: false
18+
},
19+
scales: {
20+
x: {
21+
display: false,
22+
offset: true
23+
},
24+
y: {
25+
display: false
26+
}
27+
},
28+
layout: {
29+
padding: 16
30+
}
31+
}
32+
},
33+
options: {
34+
canvas: {
35+
height: 32,
36+
width: 32
37+
}
38+
}
39+
};
709 Bytes
Loading

0 commit comments

Comments
 (0)