Only consider visible vertical boxes in layout (#8483)

This commit is contained in:
Jukka Kurkela 2021-02-21 22:43:31 +02:00 committed by GitHub
parent 5285735c0f
commit 6f0e7959df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 66 additions and 1 deletions

View File

@ -343,13 +343,16 @@ export default {
// |----------------------------------------------------|
//
const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>
wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0);
const params = Object.freeze({
outerWidth: width,
outerHeight: height,
padding,
availableWidth,
availableHeight,
vBoxMaxWidth: availableWidth / 2 / verticalBoxes.length,
vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,
hBoxMaxHeight: availableHeight / 2
});
const chartArea = Object.assign({

View File

@ -0,0 +1,62 @@
module.exports = {
config: {
type: 'line',
data: {
datasets: [
{data: [10, 5, 0, 25, 78, -10]}
],
labels: ['tick1', 'tick2', 'tick3', 'tick4', 'tick5', '']
},
options: {
plugins: {
legend: false
},
scales: {
x: {
display: false
},
y: {
type: 'linear',
position: 'left',
ticks: {
callback: function(value) {
return value + ' very long unit!';
},
}
},
y1: {
type: 'linear',
position: 'left',
display: false
},
y2: {
type: 'linear',
position: 'left',
display: false
},
y3: {
type: 'linear',
position: 'left',
display: false
},
y4: {
type: 'linear',
position: 'left',
display: false
},
y5: {
type: 'linear',
position: 'left',
display: false
}
}
}
},
options: {
spriteText: true,
canvas: {
height: 256,
width: 256
}
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB