title: Array of objects to line chart series? (+ for Crossfilter solution)
body: <p>In JavaScript, how do I transform a "long table format" to a data structure suitable for a line chart:</p>
  
  <pre><code>var data = [
    {"type":"A"," year":2000," value":50},
    {"type":"A"," year":2001," value":51},
    {"type":"A"," year":2002," value":52},
    {"type":"B"," year":2000," value":60},
    {"type":"B"," year":2001," value":55},
    {"type":"B"," year":2002," value":57}
  ]
  
  =&gt;
  
  var series = [ 
    {type: "A", values : [{x: 2000, y: 50}, {x: 2001, y: 52},] },
    {type: "B", values : [{x: 2000, y: 60}, {x: 2001, y: 55},] },
  ]
  </code></pre>
  
  <p>A vanilla JavaScript solution as well as a solution with the Crossfilter library - that can work on any dimension of the data - would be valuable:
  <a href="https://github.com/square/crossfilter/wiki/API-Reference" rel="nofollow">https://github.com/square/crossfilter/wiki/API-Reference</a></p>