title: jqPlot - How to catch double click event
body: <p>I'm using the latest version of jqPlot (v1.0.0b2_r1012) to plot my histograms.</p>
  
  <p>To catch a single click event I'm using 'jqplotDataClick' as follows:</p>
  
  <pre><code>$('#myHistogram').bind('jqplotDataClick', function(ev, seriesIndex, pointIndex, data) {
      // Do something
  });
  </code></pre>
  
  <p>Is it possible to catch a double click event instead?</p>
  
  <p>Unfortunately I've been unable to find such event in jqplot.barRenderer.js.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I've made the following two changes to my jqplot.barRenderer.js file:</p>
  
  <p><strong>Register jqplotDblClick event</strong></p>
  
  <pre><code>$.jqplot.BarRenderer.prototype.init = function(options, plot) {
      ...
      ...
      plot.postInitHooks.addOnce(postInit);
      plot.postDrawHooks.addOnce(postPlotDraw);
      plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove);
      plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown);
      plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp);
      plot.eventListenerHooks.addOnce('jqplotClick', handleClick);
      plot.eventListenerHooks.addOnce('jqplotDblClick', handleDblClick);
      //$.jqplot.eventListenerHooks.push(['jqplotDblClick', handleDblClick]); I've also tried this but without any luck
      plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick); 
  };
  </code></pre>
  
  <p><strong>Implement handleDblClick function</strong></p>
  
  <pre><code>function handleDblClick(ev, gridpos, datapos, neighbor, plot) {
      if (neighbor) {
          var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data];
          var evt = jQuery.Event('jqplotDataDblClick');
          evt.pageX = ev.pageX;
          evt.pageY = ev.pageY;
          plot.target.trigger(evt, ins);
      }
  }
  </code></pre>
  
  <p>And then I bind jqplotDataDblClick in my JavaScript file as follows:</p>
  
  <pre><code>$('#myHistogram').bind('jqplotDataDblClick', function(ev, seriesIndex, pointIndex, data) {
      alert("Ohayo!"); // Good morning in Japanese
  });
  </code></pre>
  
  <p>However the double click event doensn't get fired when I double click on one of my vertical bar graphs.  I've tried binding "jqplotRightClick" but that doesn't work either.  <strong>If I use "jqplotClick" then everything works as expected.</strong></p>
  
  <p>Does anyone know what I am doing wrong here?</p>
  
  <p><strong>Update 2:</strong></p>
  
  <p><strong>RE: I've tried binding "jqplotRightClick" but that doesn't work either. (see above)</strong></p>
  
  <p>I've just found out that in order to catch this event you have to set the following:</p>
  
  <pre><code>captureRightClick: true,
  </code></pre>
  
  <p>See: <a href="http://www.jqplot.com/deploy/dist/examples/barTest.html" rel="nofollow">How to capture right click event</a></p>