I have a data set that looks roughly like this:
var dataset = [ // apples [{\"x\": 1, \"y\": 5 }, { \"x\": 2, \"y\": 4 }, { \"x\": 3, \"y\": 2 }, { \"x\": 4,
d3.zip() comes in handy here, since you're manipulating data based on array index.
https://jsfiddle.net/guanzo/o8voyydx/2/
var result = dataset.map(d=>d.map(d=>d.y)) result = d3.zip.apply(undefined,result) result = d3.max(result.map(d=>d3.sum(d))) console.log(result )//83