Getting clicked object from each section of a single stack bar as my stack bar has multiple sections Chart.js
问题 I have developed a single Stacked bar with three section or data source. I want to know which section I have clicked. This is my code .ts file this.chart = new Chart("Chart1", { type: 'bar', data: { datasets: [{ label: 'Data1', data: [27], }, { label: 'Data2', data: [40], }, { label: 'Data3', data: [12], } ], } }); showData(evt:any){ var data = this.chart.getElementsAtEvent(evt) console.log(data[0]._model); // it prints the value of the property } In the data I am not getting data object