Activity 7 Question 1
✓ Published0🌍 Public
This example visualizes the distribution of grocery item prices by category as a pie chart, with a text legend displaying each category’s total dollar value. It loads a CSV dataset from a GitHub gist, aggregates prices per category using `d3.rollup` and `d3.sum`, and renders the chart with `d3.pie`, `d3.arc`, and an ordinal color scale (`d3.scaleOrdinal`). The SVG is drawn via D3 v6, and the legend is built as styled HTML divs, with data fetched asynchronously through `d3.csv`.
AI-generated descriptionAn example showing the capabilities of VizHub:
- Loads D3 via UNPKG.
- Demonstrates use of
importfrom"d3". - Demonstrates use of
importfrom local ES6 modules.
MIT Licensed