I stumbled upon a rather graceful solution by simply adjusting the backgroundColor stored within an array. Unfortunately, a simple render() wasn't sufficient, so I had to resort to using update()..
It would have been nice to utilize ES6 in this scenario :-)
var colorArray = ['rgb(124, 181, 236)',
'rgb(124, 181, 236)',
'rgb(124, 181, 236)',
'rgb(124, 181, 236)',
'rgb(124, 181, 236)',
'rgb(124, 181, 236)'];
var chart = new Chart(document.getElementById("trendChart"), {
type: 'bar',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: colorArray
}]
},
options:{
onClick: function(e){
var element = this.getElementAtEvent(e);
for(var i=0;i<colorArray.length;i++){
colorArray[i] = 'rgb(124, 181, 236)';
}
colorArray[element[0]._index] = 'red';
this.update()
},
scales: {
yAxes: [{
ticks: {
fontColor:'#fff'
}
}],
xAxes: [{
ticks: {
fontColor:'#fff'
}
}],
},
legend:{
display:false
}
}
})