Skip to main content
100%

Activity 7 Question 1

✓ Published0🌍 Public
Vvemulasai306@gmail.com
Last edited Nov 5, 2024
Created on Nov 5, 2024
Forked from Hello VizHub

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 description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes