Question 2 STACKED BAR CHART
This stacked bar chart shows the estimated religious composition of the 20 most populous countries in 2010, with each bar segmented by religion and colored using `scaleOrdinal` and `schemeCategory10`. Hovering over the legend highlights a religion across all countries while fading others, implemented via `colorLegend` and mouse events. The chart uses `flatRollup` and `stack` from D3 to aggregate the CSV data, with `scaleLinear` for population and `scaleBand` for countries, plus the `@curran/responsive-axes` library for axis rendering. Data originates from the Pew Research Center’s Global Religious Landscape.
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.