user1715617
user1715617

Reputation: 55

jqplot legend event handler click

hi i am trying to insert event handler to each line on the legend of jqplot something like

$('#chart3').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data) { alert(1);});); but for the legend lines

Upvotes: 0

Views: 2454

Answers (1)

nick_w
nick_w

Reputation: 14948

This worked for me:

$('#chart-id tr.jqplot-table-legend').bind('click', function() {
    alert($(this).children().last().text());
});

So what this will do is alert the name of the series.

Upvotes: 3

Related Questions