2đź‘Ť
You can use function “getPointsAtEvent”, which returns ChartElement:
ChartElement {value: 4, label: "January", datasetLabel: "My First dataset", x: 197.1083317156525, y: 125.62930048634354…}
To work with this function:
var canvas = document.getElementById("myChart") canvas.onclick = function(evt){
var activePoints = myRadarChart.getPointsAtEvent(evt);
activePoints[0].value++;
myRadarChart.update();
console.log(activePoints[0]); };
See full example: http://jsfiddle.net/pevy7vsz/29/
- [Chartjs]-Chartjs v2.5 – only show min and max on scale, absolute positioning on scale
- [Chartjs]-Chart.js version 2.2.1 wont show chart
Source:stackexchange.com