Skip to main content
100%

Divya Activity 7 Question 1

✓ Published0🌍 Public
Ddivya.matavalam828@gmail.com
Last edited Apr 6, 2025
Created on Apr 6, 2025

This pie chart visualizes total sales by product, showing proportional slices for each product in a sales dataset. The visualization uses D3.js v5 with SVG rendering, employing `d3.rollup` to aggregate sales totals per product and `d3.pie` to compute arc angles. The `d3.arc` generator draws the pie segments, while a color-coded legend identifies each product. Data is loaded asynchronously from a CSV file hosted on GitHub using `d3.csv`, with slices labeled directly on the chart via `arc.centroid`. The resulting graphic provides an at-a-glance comparison of sales performance across product categories.

AI-generated description

Pie Chart of Total Sales by Product

This D3.js visualization shows a Pie Chart for different products based on their total sales.

Dataset link:
Sales Data CSV (GitHub)

Created By: Divy260

MIT Licensed

Similar vizzes