score:1

Accepted answer

You are setting the data like this

.data(d3.values(dataset))

since your data set has two arrays., it does not mean it will draw two donut chart.

You will need to specify explicitly which of the two array will form the inner donut chart and which one outer donut chart.

For 1st donut chart you have to set the data like this:

.data(pie(dataset.weeks))//dataset for weeks

For 2nd donut chart you have to set the data like this:

.data(pie(dataset.trimester))//dataset for trimesters.

In your case you define the fie function like this:

var pie = d3.layout.pie()
    .sort(null);

It should have been like this the value function is missing which tells which value will form the criteria for the pie slice.

 var pie = d3.layout.pie()
            .sort(null).value(function (d) {
            return d.score;//since score is the parameter for the pie
        });

Working code here.

Note on hover the text will be displayed.


Related Query