Skip to main content
100%

Fork of Activity_6_Task_2_1

✓ Published0🌍 Public
LLarry Johnson
Last edited Oct 24, 2024
Created on Oct 24, 2024
Forked from Activity_6_Task_2

A horizontal stacked bar chart shows the caloric distribution percentages across ten food types, with each bar segmented into five calorie bands from "below 2.0" to "above 6.5" calories. The visualization uses D3 v7's `d3.stack()` and `d3.scaleOrdinal()` to create the stacked segments, with a color scale assigning a distinct hue to each calorie category. Rectangles are positioned via `d3.scaleLinear()` for the x-axis and `d3.scaleBand()` for the y-axis, and interactive mouseover events display precise percentage values in a styled tooltip. Data comes from the included `calories.csv` file, rendered as SVG with custom fonts and axis labels.

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