Home forums Using CanvasJS click on a legend item to get its name? Reply To: click on a legend item to get its name?

#23024

Vishwas R
Keymaster

@johnjeff,

Please refer documentation of itemClick for attaching click event to legend items. It gives event-object with chart, dataPoint, dataSeries, etc as parameters. Using e.dataSeries.name you can get the name of the legend item (if name is set for that dataSeries).

If you are still facing the issue, kindly create JSFiddle reproducing the issue you are facing so that we can look into your code, understand the issue better and help you out.


Vishwas R
Team CanvasJS