fires after a click on a legend item
event | Event | the mouse click event |
series | number | the ID of the data item or the index of the series in case there are several series in a chart |
node | HTMLElement | the HTML node of the legend item |
$$("chartWithSeries").attachEvent("onLegendClick",function(ev,series,node){
const series = this.config.series[series];
});
For charts with series the second parameter of the event is the index of the series that corresponds to the legend item. For charts without series, e.g. pie and donut charts, the second parameter is the ID of the corresponding data item.
$$("pieChart").attachEvent("onLegendClick", function(event, id, node){
const item = this.getItem(id);
});
Back to top