I am using react-chartjs-2 in my project. Let's take the first column in the example I gave. The value of blue is 50, and the value of green is 20. In this case, my expectation is that green should be 20 below blue, and blue should be 50. But chartjs calculates 50 + 20 and goes up to 70. Is there a config for this in chartjs?
<Bar
options={{
plugins: {
legend: {
display: false,
},
},
responsive: true,
scales: {
x: {
stacked: true,
grid: {
display: false,
},
ticks: {
font: { size: 12 },
},
},
y: {
stacked: true,
grid: {
borderDash: [2, 2],
color: '#e8e8e8',
},
ticks: {
font: { size: 12 },
count: 3,
},
},
},
}}
data={{
labels: week.map(day => day.format('MMM D')),
datasets: [
{
label: 'Test 3',
data: [50, 50, 50, 50, 50],
backgroundColor: 'blue',
stack: 'Stack 0',
},
{
label: 'Test 4',
data: [20, 24, 60, 90, 50],
backgroundColor: 'green',
stack: 'Stack 0',
},
],
}}
/>