Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Act7_Pie

Public visualization

Viewing a saved revision (read-only)

9e7531d002a945449bbee6eab681e00b

Act7_Pie

0 stars0🌍 Public
IIkram Mohammed
Last edited Nov 4, 2024
Created on Nov 4, 2024
Forked from Hello VizHub

This example displays a pie chart of the top 10 countries by 2022 population, with all remaining countries aggregated into an “Others” slice. Using d3.pie and d3.arc, it generates the chart from CSV data fetched via d3.csv, processes and sorts the dataset, and renders SVG paths with colors from d3.scaleOrdinal and schemeCategory10. A legend is drawn beside the chart using d3.selectAll and attribute transforms.

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.