Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity7_Question1_PieChart

Public visualization

Viewing a saved revision (read-only)

b44ed7983b57439480d6290332696473

Activity7_Question1_PieChart

0 stars0🌍 Public
DDee
Last edited Apr 10, 2025
Created on Apr 9, 2025

This pie chart visualizes chocolate sales by product for March, sourced from a CSV file hosted on GitHub. It uses D3.js to load and filter the data, calculating total sales per product with `d3.rollup` and `d3.sum`. The chart is drawn with `d3.pie()` and `d3.arc()`, while an ordinal color scale maps product names to a blue interpolated palette. A custom legend displays each product alongside its percentage of total sales, rendered as an SVG with a flexible HTML layout.

AI-generated description