title: D3 stacked bars data structure
body: <p>I have data that I want to visualize as a stacked bar chart (or whatever might be suitable):</p>
  
  <pre><code>{
      "ep1": {
          "avi": 29,
          "mov": 17,
          "mp3": 19
      },
      "ep2": {
          "avi": 13,
          "mp3": 49,
          "mp4": 37,
          "xyz": 5
      },
      ...
  }
  </code></pre>
  
  <p>However, looking at various D3 as well as NVD3 examples (e.g. <a href="http://bl.ocks.org/mbostock/3943967" rel="nofollow">http://bl.ocks.org/mbostock/3943967</a>), I'm not sure how to transform my data - whose groups are not the same across different columns - into the required data structure.</p>
  
  <p>I'd be grateful for a simple example.</p>