mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Fix layout bug when there are no visible boxes (#8507)
This commit is contained in:
parent
692d8a4128
commit
5ab5552acb
@ -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,
|
||||
|
39
test/fixtures/core.layouts/no-boxes-all-padding.js
vendored
Normal file
39
test/fixtures/core.layouts/no-boxes-all-padding.js
vendored
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
};
|
BIN
test/fixtures/core.layouts/no-boxes-all-padding.png
vendored
Normal file
BIN
test/fixtures/core.layouts/no-boxes-all-padding.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 709 B |
Loading…
Reference in New Issue
Block a user