Fork of Interactive Stacked Bar Chart
This stacked bar chart displays the estimated religious breakdown (Christian, Muslim, Hindu, Buddhist, Folk Religions, Unaffiliated, and Other) of the 20 most populous countries in 2010, using data from the Pew Research Center’s Global Religious Landscape. Rendered with D3.js, the visualization uses `flatRollup`, `stack`, `scaleLinear`, and `scaleBand` to compose the horizontal bars. A custom legend with hover interaction highlights individual religions by fading all other segments and adding a stroke to the selected category, implemented via the `colorLegend` component and `setHoveredColorValue` state.
AI-generated descriptionStacked bars showing estimated religion breakdown of the most populous 20 countries in 2010. Based on an example from the tutorial Splitting Charts. Interactions:
- Hover over the legend to highlight religions.
Data is from The Global Religious Landscape by Pew Research, generated using this processing script.