{
type: 'bar',
data: {
labels: labels,
datasets: [{
backgroundColor: Utils.color(0),
data: Utils.numbers({
count: DATA_COUNT,
min: 0,
max: 100
}),
datalabels: {
align: 'end',
anchor: 'start'
}
}, {
backgroundColor: Utils.color(1),
data: Utils.numbers({
count: DATA_COUNT,
min: 0,
max: 100
}),
datalabels: {
align: 'center',
anchor: 'center'
}
}, {
backgroundColor: Utils.color(2),
data: Utils.numbers({
count: DATA_COUNT,
min: 0,
max: 100
}),
datalabels: {
anchor: 'end',
align: 'start',
}
}]
},
options: {
plugins: {
datalabels: {
color: 'white',
display: function(context) {
return context.dataset.data[context.dataIndex] > 15;
},
font: {
weight: 'bold'
},
formatter: Math.round
}
},
aspectRatio: 5 / 3,
layout: {
padding: {
top: 24,
right: 16,
bottom: 0,
left: 8
}
},
elements: {
line: {
fill: false
},
point: {
hoverRadius: 7,
radius: 5
}
},
scales: {
x: {
stacked: true
},
y: {
stacked: true
}
}
}
}