Skip to main content
100%

D3 Example

✓ Published0🌍 Public
663anp3ca
Last edited Oct 9, 2018
Created on Oct 9, 2018

This small multiples visualization displays the religious composition of the five most populous countries—China, India, the USA, Indonesia, and Brazil—using donut charts. Each donut represents one country, with slices sized by the population of each religion, though the charts themselves are not scaled by total population. The code uses D3’s `d3.layout.pie` and `d3.svg.arc` to generate the slices, with a nested selection binding data per country. A color legend from the d3-legend library maps religions to a category10 scale, while the x-axis labels each country. The data comes from the Pew Research Center’s Global Religious Landscape dataset, rendered as SVG.

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>

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

mit Licensed

Similar vizzes