Pie Chart

When constructing data to be used with the Pie class, there must be a unique data point for each sector. Given this data array:

var myData = [
  {"Race": "White Health Center Patients", "Population Percentage": 40},
  {"Race": "Black Health Center Patients", "Population Percentage": 20},
  {"Race": "Hispanic Health Center Patients", "Population Percentage": 25},
  {"Race": "Asian Health Center Patients", "Population Percentage": 10},
  {"Race": "American Indian Health Center Patients", "Population Percentage": 5}
];

We can create a simple Pie Chart:

new d3plus.Pie()
  .config({
    data: myData,
    groupBy: "Race",
    value: function(d) {
      return d["Population Percentage"];
    }
  })
  .render();