title: Run Function On Double-Click Using Flot.js
body: <p>How do I run a function when the mouse double-clicks when using flot? If I do the following it only traps the single click.</p>
  
  <pre><code>$(graph).bind('plotclick', function(event, pos, item) {
      if (item) {
        ....
        item.series.data[0][2].key
      }
  }
  </code></pre>
  
  <p>If I use the dblclick I only have the event and no longer have the item.</p>
  
  <pre><code>$(graph).bind('dblclick', function(event) {
        ....
  }
  </code></pre>
  
  <p>How do I use double-click with flot? I need to get the name of the bar chart that I am double-clicking on.</p>
  
  <p>Edit: See here for a fiddle <a href="http://jsfiddle.net/hcszv7wb/1/" rel="nofollow noreferrer">http://jsfiddle.net/hcszv7wb/1/</a></p>
  
  <p>Edit 2: This <a href="https://stackoverflow.com/a/7676749/1000011">post</a> helps get the bar chart details by assigning the item to a variable in plothover. I just need to work out how to have the plotclick and dblclick work together now. <a href="http://jsfiddle.net/hcszv7wb/2/" rel="nofollow noreferrer">http://jsfiddle.net/hcszv7wb/2/</a></p>