🌍 Public
Viewing a saved revision (read-only)
3ef3cca28f0d4e5abc0b700cd6d472ae
Assignment2Question 1
This example visualizes 2023 sales data for different product categories as an interactive pie chart, paired with a color-coded legend. Using D3.js (v7), it loads CSV data via the `d3.csv` method and renders the chart with `d3.pie` and `d3.arc`. The chart employs a categorical color scale (`d3.scaleOrdinal` with `schemeCategory10`) for slices and legend items. Hover interactions display a tooltip showing the sales value in billions, with transitions controlling tooltip opacity. The layout places the legend on the left and the pie chart on the right within separate SVG containers.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.