Get click label in jQuery Flot event "plotclick"

So, I have a method in jQuery to detect click events on my fleet diagram:

$("#placeholder").bind("plotclick", function (event, pos, item) { alert("clicked"); }); 

I know the click values ​​from the item ['datapoint'] array. But where can I find the curve label I clicked on?

Thanks.

+6
source share
1 answer

Take a look at item.series.label :

 $("#placeholder").bind("plotclick", function (event, pos, item) { if (item) { alert(item.series.label); } }); 

Fiddle is here .

+7
source

All Articles