Fork of Step 1 - A Basic Pie Chart
✓ Published0🌍 Public
This example shows a basic pie chart created with D3 v4, rendering an SVG visualization of four labeled data categories with proportional slice sizes and distinct colors from the Category 20b scheme. The code loads D3 via UNPKG, uses `d3.select`, `d3.arc`, `d3.pie`, and `d3.scaleOrdinal` to generate the chart dynamically from a JavaScript array of label-count pairs. The repository also includes a separate Canvas-based pie chart implementation in `pie.js`, which draws segments and labels using context methods like `arc`, `fillText`, and `rect`, with data defined in a Module.
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.
MIT Licensed