title: Prepare nested JSON data for D3 stacked bar chart
body: <p>I have nested JSON data where the first level of keys is activity types (ride, hike, etc.) and the second level is the year. Each year has a value (distance in kilometers).
  My data structure looks like this:
  <a href="https://i.stack.imgur.com/53Nld.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/53Nld.png" alt="enter image description here"></a></p>
  
  <p>I want to draw a stacked bar chart like this <a href="http://bl.ocks.org/mstanaland/6100713" rel="nofollow noreferrer">http://bl.ocks.org/mstanaland/6100713</a> from my data. How can I bring my data in a structure which is suitable for a D3 stacked bar chart?</p>