act8_question2
✓ Published0🌍 Public
A horizontal stacked bar chart displays the percentage distribution of six food categories across seven rating bands, from “Below 4” to “Above 8.” Each bar represents a category, with colored segments showing the proportion of ratings in each band. The visualization uses D3 v7’s `d3.stack` to aggregate the data, `d3.scaleOrdinal` for color mapping, and `d3.scaleLinear` and `d3.scaleBand` for axes. Interactive tooltips appear on mouseover, displaying the exact percentage for each segment. Data is loaded from a CSV file.
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