score:8

Accepted answer

You can use d3.nest() to group your data into week numbers

First, we need to define a time parser that would give you the week number of a date object

var week = d3.time.format("%U");

Then create a nest object

var nest = d3.nest()
    .key(function (d) {
         return week(new Date(d.date));
    })
    .entries(data.test);

The nest object will be an array that contains your data grouped into week numbers

A live demo with your data can be found at http://jsfiddle.net/1bf2cqw3/ You can take a look at the nest object in the console


Related Query