Remove stacking from line chart
Hi ,
I have a stacked bar chart with two line charts. The second line chart is also beeing stacked on top of the first line chart but I need it without stacking.
The basis from the chart is from this post tried already to explicit set the option stacking false but it has no effect:
var barChartData = {
labels: dates,
datasets: [{
type: 'bar',
label: 'chart1',
data: data1
}, {
type: 'bar',
label: 'chart2',
backgroundColor: "rgba(153, 217, 127, 0.6)",
borderColor: "rgba(25, 216, 0, 1)",
data: data2,
}, {
type: 'line',
label: 'lineChart1',
data: lineData1,
borderWidth: 1,
fill: false,
options: {
legend: {
display: false
},
scales: {
xAxes: [{
stacked: false,
}],
yAxes: [{
stacked: false
}]
}
}
}, {
type: 'line',
label: 'lineChart2',
data: lineData2,
fill: false,
options: {
scales: {
xAxes: [{
stacked: false,
}],
yAxes: [{
stacked: false
}]
}
}
},
]
};
@mvahsen since stacking is per axis, one way to deal with this is to put the line charts on another axis and then make that axis not stack
@mvahsen doing what you are requesting shouldn't be a problem. Perhaps you just don't have the correct options configured (I did not look at them closely). Here is an example.
Closing as out of date