Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.rawgit.com/lodash/lodash/3.0.1/lodash.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
data = [
  [
    {"name":"cpumhz","data":[[1433856538,0],[1433856598,0]]},
    {"name":"mem","data":[[1433856538,13660],[1433856598,13660]]}
  ],
  [
    {"name":"cpumhz","data":[[1433856538,0],[1433856598,0]]},
    {"name":"mem","data":[[1433856538,13660],[1433856598,13660]]}
  ],
  [
    {"name":"cpumhz","data":[[1433856538,0],[1433856598,0]]},
    {"name":"mem","data":[[1433856538,13660],[1433856598,13660]]}
  ]
];
res = []
cpudata = _.flatten([data[0][0].data, data[1][0].data, data[2][0].data])
res.push({name: 'cpumhz', data: cpudata})
cpudata = _.flatten([data[0][1].data, data[1][1].data, data[2][1].data])
res.push({name: 'mem', data: cpudata})
console.log(res);
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers