Skip to main content
100%

task9_question1

✓ Published0🌍 Public
Sshivasaikumart@gmail.com
Last edited Apr 22, 2024
Created on Apr 22, 2024
Forked from Hello VizHub

This example presents a pie chart of total sales by product line, using data from a supermarket sales CSV file. The chart uses D3.js v7 to create an SVG-based visualization with color-coded slices, a legend, and percentage labels. It demonstrates loading external data via `d3.csv` and performing aggregation with `d3.sum` and `d3.pie` to compute segment values. The code also uses `d3.scaleOrdinal` with `d3.schemeCategory10` for coloring and interactive hover effects that modify slice opacity, all rendered in the browser through the SVG API.

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