Viewing a saved revision (read-only)
c678d232312846b685bafed9c49ed982
Assignment 2 Piechart
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 descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.