Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Assignment 2 question1

Public visualization

Viewing a saved revision (read-only)

4257e42523804e729572ac79a704fc0a

Assignment 2 question1

0 stars0🌍 Public
BBhavana Sharma
Last edited Apr 9, 2024
Created on Apr 9, 2024
Forked from Hello VizHub

This example displays a pie chart of three sample categories with proportional slices, a legend, and axis labels. It renders as SVG using D3 v7, loading the library from UNPKG. The code uses `d3.pie()` for data layout, `d3.arc()` for path generation, `d3.scaleOrdinal` with `d3.schemeCategory10` for colors, and appends slices, legends, and labels via D3’s data join methods (`selectAll`, `enter`, `append`). The chart is built dynamically from static, hardcoded data.

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.