September 2016
Beginner to intermediate
531 pages
12h 55m
English
The preceding bar chart reveals that Ed Miliband received the most donations during this period. Let's find out who's making him so popular.
We are going to use the pie chart layout to cut the donations to The Rt Hon Edward Miliband MP into slices, showing how many donations he got from each donor. After filtering the dataset for donations going to Miliband, we have to categorize the entries by givers, and finally we feed them into the pie chart layout to generate a pie chart.
We can use the histogram layout to put data into bins depending on the DonorName property. Let's add a function to helpers.js:
export function binPerName (data, name) { let nameIds = nameId(data, name); let histogram = d3.layout.histogram() ...Read now
Unlock full access