Accepted answer

You are currently setting pie to the return of the function d3.pie()(category_count). d3.pie() itself returns a function. So what you would want to do is this:

var pie = d3.pie()
      .value(function(d) {
        return d.value;

Then when you call it like this:

var arcs = svgPie.selectAll("arc")
        function(d) {

This is now invoking the function pie with the arguments category_count.

Related Query

More Query from same tag