Skip to main content
100%

Activity 7 Pie Chart

✓ Published1🌍 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.
MIT Licensed

Similar vizzes