Chart.js
Chart.js copied to clipboard
Superimposed bar chart
Feature Proposal
I need a superimposed bar chart
The stacked bars are not suitable because bars are located one on top of the other, whereas I need that all bars starts at 0
The best I could get was using staked floating bars, but the problem is that the smallest bar is not always in front :
{
type: 'bar',
data: {
labels: ['Q1', 'Q2', 'Q3', 'Q4'],
datasets: [{
label: 'Users',
backgroundColor: 'rgba(255, 0, 0, 1)',
data: [[0, 2], [0, 1], [0, 1], [0, 1]]
}, {
label: 'Revenue',
backgroundColor: 'rgba(0, 0, 255, 1)',
data: [[0, 1], [0, 2],[0, 3], [0, 4]]
}]
},
options: {
scales: {
xAxes: [{
stacked: true
}]
}
}
}
There is no way to force bar to be drawn after?
Possible Implementation
No response
You can only stack the x axis as you suggested:
options: {
scales: {
x: {
stacked: true
}
}
}