D3 Example
Small multiples of donut charts display the religious composition of the five most populous countries. Each donut’s area is proportional to that country’s total population, making the visualization more honest than a fixed-size comparison. The code uses `d3.nest()` to group data by country, `d3.layout.pie()` and `d3.svg.arc()` to construct the arcs, and a square-root `radiusScale` tied to population sums. Data comes from the Pew Research Center’s Global Religious Landscape dataset. A categorical `colorScale` and a `d3.legend.color()` legend encode the religions, with an `xAxis` labeling each country.
AI-generated descriptionA small multiples visualization of donut charts showing the breakdown of religions for the largest 5 countries.
Note that area is proportional to population, because the area of each pie corresponds to the population of each country (the sum of all religions). This makes the visualization more "honest" than the fixed size Donut Chart Small Multiples.
- Data from Pew Research Center Global Religious Landscape data set
- Uses d3-legend
- Uses nested selections.
forked from <a href='http://bl.ocks.org/curran/'>curran</a>'s block: <a href='http://bl.ocks.org/curran/e025a50dbaae7186e516'>Sized Pie Charts</a>
Thanks to enjalot for the idea to size each donut.
<!-- Start of SimpleHitCounter Code --> <div align="center"><a href="http://www.simplehitcounter.com" target="_blank"><img src="http://simplehitcounter.com/hit.php?uid=1980885&f=16777215&b=0" border="0" height="18" width="83" alt="web counter"></a></div> <!-- End of SimpleHitCounter Code -->