🌍 Public
Viewing a saved revision (read-only)
21ba4e7ddd5e46f1b43678eca3457f60
Pie Chart
This example presents a pie chart depicting the total sales distribution across item categories, sourced from a CSV file. The visualization includes a legend, a title, and a subtitle, with each slice labeled by its category and dollar amount. Built with D3.js v6, the code uses `d3.pie()` and `d3.arc()` to generate the chart, `d3.rollups` to aggregate the data, and `d3.scaleOrdinal` with `d3.schemeCategory10` for coloring. The chart is rendered as SVG elements, with annotations and labels positioned using arc centroids.
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.