Get clicked label in jQuery Flot "plotclick" event -


so have method in jquery catching click events on flot chart:

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

i know clicked values item['datapoint'] array. can find label of curve clicked?

thanks.

look @ item.series.label:

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

fiddle here.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -