Need assistance in adding a property to dataset/label for identification on click. Previous attempts include:
Chart.controllers.customBar = Chart.controllers.bar.extend({
code: null
});
Progress has been made as the new property "code" is visible, data is associated with it, however the chart background displays but no data from datasets are visible.
Here's my initialization:
var ctx = document.getElementById("roads-chart").getContext("2d");
window.roadsBar = new Chart(ctx, {
type: 'bar',
data: roadsChartData,
options: {
title: {
display: true,
text: "Road Status"
},
tooltips: {
mode: 'label'
},
responsive: true,
scales: {
xAxes: [{
stacked: true,
}],
yAxes: [{
stacked: true
}]
},
onClick: function(e, d) {
console.log(d);
}
}
});
Seeking help with understanding Chart.js and demonstrations on extending functionalities. Can anyone assist?
Thank you