Chartjs-How to know which stack is clicked, in a grouped stacked bar (chartjs)?

0๐Ÿ‘

I found a way usign chart.getElementAtEvent(evt)

let chart = this.$refs.barChart.$data._chart;

                let datasetIndex = chart.getElementAtEvent(evt)[0]._datasetIndex

                let stack = chart.getDatasetMeta(datasetIndex).stack;

Leave a comment