Question 2 activity 6
✓ Published0🌍 Public
A stacked bar chart displays product ratings across three categories: low, moderate, and excellent, using percentage proportions loaded from a local CSV file. D3 v7’s `d3.stack` and `scaleOrdinal` assign colors to rating segments, while `scaleBand` positions products on the y-axis and `scaleLinear` maps proportions to bar widths. Interactive tooltips appear on mouseover, showing formatted percentage values for each rating type. The SVG renderer applies axes with gridlines, a title, and axis labels, styled via external CSS.
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