Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Assignment 2 Piechart

Public visualization

Assignment 2 Piechart

0 stars0🌍 Public
Nnarasimhacharyulu010@gmail.com
Last edited Apr 13, 2024
Created on Apr 13, 2024

This pie chart visualizes the sales distribution of four tech products—Laptops, Smartphones, Tablets, and Desktops—using a static SVG rendering. The chart shows percentage labels on each slice and includes a legend that maps colored rectangles to product names and their corresponding sales percentages. The code utilizes D3 v5 APIs including `d3.pie`, `d3.arc`, and `d3.scaleOrdinal` to generate the pie geometry and color mapping, with values computed from a hardcoded dataset. The visualization, built within a React framework, displays the chart centered with a red title and legend positioned to the right.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed