Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity 7 Pie Chart

Public visualization

Viewing a saved revision (read-only)

8b1c877966984c109e9593b1cd6e1a1d

Activity 7 Pie Chart

0 stars1🌍 Public
KKhushi Desai
Last edited Nov 4, 2024
Created on Nov 2, 2024
Forked from Hello VizHub

This pie chart visualizes the Happiness Dataset, showing the happiness scores of the top 20 countries with all remaining countries aggregated into an "Others" slice. D3's `pie` and `arc` generators create the SVG slices, while `scaleOrdinal` with `schemeCategory10` assigns colors, and a custom legend is drawn alongside. The data is loaded asynchronously via D3's `csv` method from a GitHub gist, with the `processData` function sorting and aggregating scores before rendering.

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.