Activity-7 Question-1
✓ Published0🌍 Public
This example renders a pie chart of the top ten cars by miles per gallon (mpg) from a CSV file loaded from a GitHub gist. D3's `pie` layout and `arc` generator create the slices, with each car assigned a random color via JavaScript. The chart displays mpg labels directly on each slice and includes a legend listing car names. The SVG is generated using D3 v5, with the data fetched using D3's `csv` function and sorted/sliced before rendering.
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