I have this static dataset's data ranging from 2015 to 2016 and I want to map everything out instead of manually adding the bars myself.
final_water_supply
Data image representation
var ctx = document.getElementById('mc').getContext('2d');
chartRef1 = new Chart(ctx, {
type: 'bar',
data: {
labels: sortedData,
datasets: [{
label: '2015',
stack: 'Stack 1',
data: final_water_supply[0],
backgroundColor: '#D0D1E6',
borderColor: '#D0D1E6',
},
{
label: '2016',
stack: 'Stack 2',
data: final_water_supply[1],
backgroundColor: '#74A9CF',
borderColor: '#74A9CF',
},
{
label: '2017',
stack: 'Stack 3',
data: final_water_supply[2],
backgroundColor: '#0570B0',
borderColor: '#0570B0',
},
{
label: '2018',
stack: 'Stack 4',
data: final_water_supply[3],
backgroundColor: '#023858',
borderColor: '#023858',
}
]
},