Skip to main content
100%

D3 Example

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

This visualization displays small multiples of donut charts, one per country, showing the religious breakdown of the five most populous nations. Each donut uses the same fixed radius, so the charts show only the proportion of religions within each country, not the total population, making the visual misleading for cross-country comparison. The code uses D3’s `d3.layout.pie` and `d3.svg.arc` to generate the slices, with nested selections via `d3.nest()` to group data by country. A color legend from `d3-legend` maps religions to colors, and the data comes from the Pew Research Center’s Global Religious Landscape dataset, loaded from a CSV file.

AI-generated description

A small multiples visualization of donut charts showing the breakdown of religions for the largest 5 countries. This is example 31 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 donut 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=1980290&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a></div> <!-- End of SimpleHitCounter Code -->

Similar vizzes