Is there a getPointsAtEvent() equivalent that returns the LABEL associated with the data point?
I'm in the process of trying to write a custom function to accomplish this, but thought I'd check to see if someone else had already done it. Essentially instead of the data point value being returned I'd like the label associated WITH that data point value to be returned.
Use Case: I'm looking at a bar chart of sales by month... I click on the bar, it returns the month.
So it might be called, getLabelByPoint() or getLabelsByBar() or something like that...
Progress update... set the canvas' onclick event to fire the getRelativePosition(e) method to obtain the x, y coordinates. Used the dataset object of my chart instance to return the x,y coordinates of each data point/label. I plan on looping over each data point coordinates and comparing to the onclick coordinates to determine the label of the datapoint/bar that was clicked. Right path? Overkill? Make sense?
As far as I know, nothing like this exists in version 1. Version 2 has something similar to what you'd like using
scale.getLabelForIndex(dataIndex, datasetIndex)