title: How to flip x-y axis on click using d3
body: <p>I am using d3 chart to plot some charts.</p>
  
  <p>I am looking for something by which I can flip my axis on a click of a button. Having said that I mean, I am looking for the functionality which seamlessly works for all type of charts like bar, line, stack etc.</p>
  
  <p>Has anyone done some awesome work like this? Please help</p>
  
  <pre><code>Here is the sample
  </code></pre>
  
  <p><a href="http://jsfiddle.net/adityasethi2601/ae5BP/" rel="nofollow">http://jsfiddle.net/adityasethi2601/ae5BP/</a></p>