Skip to main content
100%

D3 Example

✓ Published0🌍 Public
CCurran Kelleher
Last edited Nov 23, 2015
Created on Nov 23, 2015

This is a small-multiples visualization of pie charts showing the religious breakdown of the five most populous countries. Each country’s donut chart displays the proportion of its population following each religion, but the charts are all the same size, so area is not proportional to population, which can be misleading. The code uses D3’s `d3.layout.pie` and `d3.svg.arc` to generate the slices, with nested selections binding data to each chart. It also employs the d3-legend library for the color legend and renders as SVG. Data comes from the Pew Research Center’s Global Religious Landscape dataset.

AI-generated description

A small multiples visualization of pie charts showing the breakdown of religions for the largest 5 countries. This is example 32 from the screencast Splitting Charts.

Note that area is not proportional to population, because the donuts are all the same size, regardless of population. This visualization shows the proportions of different religions within each country only. This property makes this visualization misleading in a way. For example, Brazil gets just as many pixels as China while being only a fraction of the population. To remedy this, it would be better to size each pie chart based on the population of each country.

forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/40d5e61963abf20da067'>Polar Area Small Multiples</a>

<!-- Start of SimpleHitCounter Code --> <div align="center"><a href="http://www.simplehitcounter.com" target="_blank"><img src="http://simplehitcounter.com/hit.php?uid=1980810&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a></div> <!-- End of SimpleHitCounter Code -->

forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/11b02f8917fac66d6fe5'>Donut Chart Small Multiples</a>

Similar vizzes