Skip to main content
100%

Assignment 2 Pie Chart

✓ Published0🌍 Public
Jjaswanthreddy2000@gmail.com
Last edited Apr 10, 2024
Created on Apr 9, 2024
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes