You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case anyone would like to get the index of bar they are hovering, replace the whole function with code above.
By calling:
$canvas.on('click', function(evt) {
var bar = chart.getBarsAtEvent(evt, true);
console.log(bar);
});
bar[0] would be the original bar data and bar[1] is the index. Noted that bars are drawn in reverse order. i.e. the first data you pushed will be the last one to be drawn
The text was updated successfully, but these errors were encountered:
In case anyone would like to get the index of bar they are hovering, replace the whole function with code above.
By calling:
bar[0]
would be the original bar data andbar[1]
is the index. Noted that bars are drawn in reverse order. i.e. the first data you pushed will be the last one to be drawnThe text was updated successfully, but these errors were encountered: