task9_question1
✓ Published0🌍 Public
This example presents a pie chart of total sales by product line, using data from a supermarket sales CSV file. The chart uses D3.js v7 to create an SVG-based visualization with color-coded slices, a legend, and percentage labels. It demonstrates loading external data via `d3.csv` and performing aggregation with `d3.sum` and `d3.pie` to compute segment values. The code also uses `d3.scaleOrdinal` with `d3.schemeCategory10` for coloring and interactive hover effects that modify slice opacity, all rendered in the browser through the SVG API.
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