Skip to main content
100%

Shapes: Pie Example

✓ Published0🌍 Public
DDanielAguirre
Last edited Oct 7, 2017
Created on Oct 7, 2017

This example displays a small pie chart built from an array of seven numeric values, with each slice sized proportionally to its value. The visualization uses D3 v4’s `d3.scaleOrdinal` with the `d3.schemaCategory10` color palette to assign distinct colors to each segment. The chart is rendered as an SVG element, where the arcs are generated using the `d3.arc` API with an inner radius of zero and an outer radius of ten, and angles are computed via `d3.pie()` before being passed to the arc’s start and end angle functions. The data itself is hard-coded in the script, and the code originates from a gist by DanielAguirre, structured for use with Blockbuilder.

AI-generated description

Built with blockbuilder.org

mit Licensed

Similar vizzes