I'm drawing a line graph using Flot. It's updated in real-time and has multiple series. I want to be able to detect left and right mouse clicks on individual series in the graph.
Currently, I can detect a left mouse click, but right-click just brings up my browser's right-click menu.
Here's what I've got so far:
function myClick(event, pos, obj) {
if (!obj) {
return;
}
alert('clicked!');
}
var placeholder = $("#placeholder");
// setup plot
var options = {
...
grid: {clickable: true, hoverable: true},
...
};
var initialData = getMyData();
var plot = $.plot(placeholder, initialData , options);
placeholder.bind("plotclick", myClick);
Is there a way to detect right-clicks on a series in the graph?