Rebuilt on Chart.js -- Rickshaw hasn't shipped a release since 2016.
Below is the basic bar chart example.
Source Code
new Chart(document.getElementById('chartBar1'), {
type: 'bar',
data: {
labels: ['0', '1', '2', '3', '4'],
datasets: [{
data: [40, 49, 38, 30, 32],
backgroundColor: '#26A2E2'
}]
},
options: {
scales: { y: { beginAtZero: true, max: 80 } }
}
});
Below is the stacked bar chart example.
Source Code
datasets: [
{ data: [20, 30, 10, 15, 10], backgroundColor: '#466C79' },
{ data: [10, 10, 15, 20, 12], backgroundColor: '#26A2E2' }
],
options: {
scales: {
y: { stacked: true },
x: { stacked: true }
}
}
Below are multiple bar chart example.
Additional Option Code
// Bars are grouped, not stacked, by default -- only set
// scales.x.stacked/scales.y.stacked to true if you want stacking.
Below is the line chart example.
Option Code
type: 'line'
Below is the area chart example.
Option Code
datasets: [{
data: [40, 49, 38, 30, 32],
fill: true,
backgroundColor: 'rgba(38,162,226,.4)'
}]