Accepted answer

you should be able to use the getelementsatevent method, like so

document.getelementbyid("mychart").onclick = function(evt){
    var activepoints = myradar.getelementsatevent(evt);
    // use _datasetindex and _index from each element of the activepoints array

fiddle -


calling getelementsatevent(event) on your chart instance passing an argument of an event, or jquery event, will return the point elements that are at that the same position of that event.

var canvas = document.getelementbyid("mychart");
var myradar = new chart(canvas, config);
canvas.onclick = function(evt) {

    // => activepoints is an array of points on the canvas that are at the same position as the click event.
    var activepoint = myradar.getelementsatevent(evt)[0];

    if (activepoint !== undefined) {
        var dataset =[activepoint._datasetindex];
        var title =[activepoint._index];
        var oldvalue =[activepoint._index];
        var newvalue = oldvalue + 10;[activepoint._index] = newvalue;

    // calling update now animates element from oldvalue to newvalue.

    console.log("dataset: '"+ dataset.label + "' element '" + title + "' value updated from: " + oldvalue + " to: " + newvalue);


another way to achieve this in chartjs 2.0 is to use the lastactive property of the radar chart.

var myradar = new chart(document.getelementbyid("mychart"), config); = true; = 'single';
document.getelementbyid("mychart").onclick = function (evt) {
var activepoint = myradar.lastactive[0];
if (activepoint !== undefined) {
        var datasetindex = activepoint._datasetindex;
                var index = activepoint._index;
                var datasetname =[datasetindex].label;
                var title =[index];
                var datavalue =[datasetindex].data[index];
                alert("dataset name: [" + datasetname + "] title: [" + title + "] value: [" + datavalue + "]");


in addition you can use var activepoints = chartobj.getelementsatxaxis(evt); to get the nearest active element based just on the x-axis. (super useful for when you have some really small values)


i have a graph with multiple data sets. using the proposed getelementsatevent(evt) function, returns all data sets at a given x position but not only the single dataset index that i clicked on. so, there is no possibility to identify the individual data set.

to get only the single point clicked on:

const activepoint = chartobj.getelementatevent(event);
const datasetindex = activepoint[0]._datasetindex;
const itemindex = activepoint[0]._index;

notice the missing "s" in getelementatevent() compared to getelementsatevent().

Related Query

More Query from same tag