Pie Chart
✓ Published1🌍 Public
A pie chart visualizes the distribution of documentary film titles by their associated values and percentages, with an accompanying legend displaying each label, numeric value, and percentage. The chart uses D3 v5’s `pie()` generator with a null sort to compute arc segments, which are rendered as SVG paths via the `arc()` function. A color scale (`scaleOrdinal`) maps values to a custom palette. The legend is built manually with rectangles and text elements, formatted using `format('.4~g')` for the values. The data is loaded asynchronously from a local JSON file using `json()`.
AI-generated descriptionMIT Licensed