🌍 Public
Viewing a saved revision (read-only)
4b10c82c52604a8086cb7ac61f3c6689
Task8_Tutorial1
This stacked bar chart visualizes the estimated religious composition of the 20 most populous countries in 2010, using data from the Pew Research Center's Global Religious Landscape. The chart uses `d3.flatRollup` and `d3.stack` to structure the data, with `d3.scaleLinear` for the x-axis (population in millions) and `d3.scaleBand` for the y-axis (countries). A color legend, built with `colorLegend.js`, allows users to hover over a religion to highlight its segments across all bars while fading others, using `d3.scaleOrdinal` with `schemeCategory10` for color assignment.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.