Fork of Activity_6_Task_2_1
✓ Published0🌍 Public
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 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