Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

William_Task9_10

Public visualization

Viewing a saved revision (read-only)

f30c95ba4f2d409b80347bb959a2bef6

William_Task9_10

0 stars1🌍 Public
WWilliam Nsambu
Last edited Apr 20, 2024
Created on Apr 20, 2024

This pie chart visualizes the proportion of units sold for each product ID from an inventory CSV file. The visualization uses D3.js v7 to load the data, transform it into name-value pairs, and render a categorical pie chart. The code applies the d3.pie and d3.arc APIs to generate the pie segments and a d3.scaleOrdinal color scheme with the category10 palette. Each slice is labeled with the product ID and rendered as an SVG within a 500 by 500 pixel canvas.

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.