Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Pie Chart

Public visualization

Viewing a saved revision (read-only)

45b0170ff67d40d2ba44d3b81f5a4cca

Pie Chart

0 stars0🌍 Public
CChaitanya Ratan Sree
Last edited Nov 6, 2024
Created on Nov 6, 2024
Forked from Hello VizHub

This pie chart visualizes the basic cost of each country, with slices colored by country and a legend displaying names and dollar amounts. The D3.js v5 code loads CSV data from a GitHub gist and uses `d3.pie` and `d3.arc` to generate the SVG paths, with `d3.scaleOrdinal` and `schemeCategory10` for colors. A hover event logs the country and cost to the console, while the legend is built from the same pie 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.