Fork of Religions of Largest 20 Countries
This stacked bar chart visualizes the estimated 2010 religious breakdown of the 20 most populous countries, using data from the Pew Research Center. Each bar shows a country’s total population segmented by religion, with tooltips revealing exact values on hover. The visualization uses D3 v3’s `d3.layout.stack`, `d3.scale.ordinal`, and `d3.svg.axis`. The color legend is built with `d3.legend`, and highlighting a religion in the legend dims other bars via a semi-transparent overlay while redrawing the selected layer in a foreground group. The SVG rendering includes a custom SI tick formatter that converts billions to “B.”
AI-generated descriptionStacked bar chart showing estimated religion breakdown.
Interactions:
- Hover over the bars for tool tips.
- Hover over the legend to highlight religions.
Based on an example from the tutorial Splitting Charts. Derived from the following examples published on bl.ocks.org:
Estimated 2010 religion breakdown of the most populous 20 countries.
Data is from The Global Religious Landscape by Pew Research, generated using this processing script.
TODO: Upgrade dependencies to latest D3 & friends.