Assignment 2 Pie Chart
✓ Published0🌍 Public
This example visualizes the highest electricity consumption by country as a pie chart, with each slice colored and labeled with its consumption value, alongside a legend listing country names and figures. It loads data from a CSV file hosted on GitHub, using D3 v5 APIs including `d3.csv`, `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to process the data and generate SVG paths, text, and rectangles. The chart is rendered with an inner radius of zero, and styling is applied via external CSS classes.
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