Skip to main content
100%

Viz1

✓ Published1🌍 Public
Ssaishruthik2361@gmail.com
Last edited Nov 5, 2024
Created on Nov 4, 2024
Forked from Hello VizHub

This example uses a pie chart to display the distribution of COVID-19 cases across different countries, with each slice sized by the total number of cases. It is built with D3 v6, utilizing `d3.select`, `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to render the chart as an SVG. Hovering over a slice triggers a tooltip that shows the specific case count and percentage of the total, calculated with `d3.sum`. The data is loaded from a CSV file using `d3.csv`, and a legend is added with colored rectangles and country labels.

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