Viewing a saved revision (read-only)
148a4ab766a343c8a37dd76c5096c2d8
activity 6_Q2
This visualization shows the distribution of customer ratings across six cosmetic brands, using horizontal stacked bar charts to compare the proportion of ratings in five percentage ranges from below 5.0 to above 8.5. Each bar segment is colored by rating category, with a tooltip revealing the exact percentage for each brand and rating range on hover. The chart uses d3.stack() to compute the stacked data, d3.scaleLinear and d3.scaleBand for positioning, and d3.axisBottom with tick lines for the percentage scale. Data comes from a CSV file, rendered as SVG elements with mouseover events that adjust opacity and display tooltip information.
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.