D3 Example
✓ Published0🌍 Public
CCurran Kelleher
Last edited Nov 22, 2015
Created on Nov 21, 2015
A pie chart of world religions uses a color legend to distinguish seven global religious groups by population. The D3.js code loads data from a CSV file and renders an SVG pie chart with an ordinal x-axis and categorical color scale. It employs `d3.layout.pie` and `d3.svg.arc` for the slices, and the `d3.legend.color` API from the d3-legend library to generate the color legend. The visualization highlights the relative sizes of religious populations, with Christianity as the largest segment.
AI-generated descriptionA pie chart of world religions with a color legend. This is example 27 from the screencast Splitting Charts.
- Data from Pew Research Center Global Religious Landscape data set
- Using d3-legend
- Draws from Using d3-legend