Skip to main content
100%

Activity 7-Q 1

✓ Published1🌍 Public
Ttallapanenisahithi@gmail.com
Last edited Nov 6, 2024
Created on Nov 6, 2024
Forked from Activity6_task 3

This example displays the distribution of chocolate sales percentages across eight chocolate types using a pie chart with a manually constructed legend and axis labels. It loads sales data from a remote CSV file and renders the chart as an SVG using D3 v6. The code uses `d3.csv` to fetch data, `d3.pie` to compute arc angles, `d3.arc` to generate SVG paths, and `d3.scaleOrdinal` to assign colors to each chocolate type. A static legend lists each type alongside its percentage, while text labels are placed at arc centroids.

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