Skip to main content
100%

Task 8 Tutorial 4 question

✓ Published0🌍 Public
YYeshwanth963@gmail.com
Last edited Apr 14, 2024
Created on Apr 14, 2024
Forked from Hello VizHub

This example demonstrates a packed bubble chart using D3 v4, visualizing a dataset of food items with their associated counts. The chart renders circles of varying sizes on a 600-pixel square SVG canvas, with each bubble representing an item and its area proportional to the count value. The implementation uses D3’s `d3.pack` layout, `d3.hierarchy` for tree building, and `d3.scaleOrdinal` with the `schemeCategory20` color palette to assign distinct colors. Each bubble includes a white label showing the item name and count, rendered with `d3.select` and SVG attributes.

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