Skip to main content
100%

Activity 6_Task 2 Q2

✓ Published0🌍 Public
Aakankshareddygorla@my.unt.edu
Last edited Oct 21, 2024
Created on Oct 21, 2024
Forked from Hello VizHub

This example visualizes the nutritional breakdown of 80 cereal products as a stacked bar chart. It uses a D3.js v7 SVG rendering with a horizontal layout, showing the contribution of three nutrient categories (calories, protein, fat) per cereal brand, as specified in the data.csv file. The chart employs `d3.stack()` for data stacking, `d3.scaleBand()` for the categorical y-axis, and `d3.scaleLinear()` for the quantitative x-axis. Interactive tooltips display exact values per category and cereal when hovering over each bar segment, using D3’s event handlers (`mouseover`, `mousemove`, `mouseout`).

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes