Activtiy-6-q2.3
✓ Published0🌍 Public
This example visualizes sales distribution across product categories, breaking down each category's total sales into five segments based on rating scores (from "less than 5" to "greater than 8.5"). The chart uses stacked horizontal bars, with each product category represented as a bar segmented by colored sections corresponding to rating ranges. The visualization is built using D3 v7, loading data from a local CSV file, and employs `d3.stack()` to compute stacked bar positions, `d3.scaleBand()` for categorical y-axis positioning, and `d3.axisLeft` and `d3.axisBottom` for axes. Interactive tooltips appear on hover, displaying the specific rating segment and its sales value.
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