Chartjs-Links in bar charts (charts.js)

1๐Ÿ‘

โœ…

I know you required bar chart but I have used in doughnut chart
I hope this will help you..

find example here:- https://jsfiddle.net/ha19ozqy/

document.getElementById("myChart").onclick = function(evt){
            var activePoints = myChart.getElementsAtEvent(evt);
            var firstPoint = activePoints[0];
            var label = myChart.data.labels[firstPoint._index];
            var value = myChart.data.datasets[firstPoint._datasetIndex].data[firstPoint._index];
            if (firstPoint !== undefined)
                alert(label + ": " + value);
        };

Leave a comment