Skip to main content
100%

Activity-7 Question-1

✓ Published0🌍 Public
Kkandulasunny17@gmail.com
Last edited Nov 5, 2024
Created on Nov 5, 2024

This example renders a pie chart of the top ten cars by miles per gallon (mpg) from a CSV file loaded from a GitHub gist. D3's `pie` layout and `arc` generator create the slices, with each car assigned a random color via JavaScript. The chart displays mpg labels directly on each slice and includes a legend listing car names. The SVG is generated using D3 v5, with the data fetched using D3's `csv` function and sorted/sliced 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