 <p>Here is an interim solution (non D3) that I've come up with to structure the data the way that the D3 set up wants it. Comments welcome.</p> <pre><code>var data = [ {}, {}, {}, ... ] // see above var dataSets = ["a","b","c"] var newArr = []; data.map(function(a) { var prop; var _this = this; dataSets.map(function(k) { prop = a.date+"|"+k; if (!_this[prop]) { _this[prop] = { key: k, value: 0, date: a.date }; newArr.push(_this[prop]); } if (prop === a.date+"|"+k) { _this[prop].value += parseInt(a[k]); } }); }, Object.create(null)); console.log("reduced data", newArr); </code></pre>