Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

7.1 Question 1

Public visualization

Viewing a saved revision (read-only)

f2839469d7b548a292c188a6b03c8520

7.1 Question 1

0 stars0🌍 Public
Ssaishruthik2361@gmail.com
Last edited Nov 2, 2024
Created on Nov 2, 2024
Forked from Hello VizHub

This example shows a fruit distribution pie chart, visualizing the quantity of each fruit in a CSV dataset loaded from a GitHub gist. D3 v5 loads the data with `d3.csv`, converts it to an object mapping fruit names to numeric quantities, and uses `d3.pie` and `d3.arc` to generate the SVG paths. Each slice is filled with a categorical color from `d3.schemeSet2` via `d3.scaleOrdinal`, and labeled with the fruit name using SVG text elements positioned at each arc’s centroid.

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.