Activity-6 Task-3
✓ Published0🌍 Public
This example visualizes the distribution of vegetable pH ratings across five categories, from below 5.0 to above 8.5, using a horizontal stacked bar chart. Each bar represents a vegetable, with segments colored by pH range and a tooltip showing the exact percentage on hover. The code loads D3 v7 via UNPKG, uses `d3.stack()` to compute stacked series, `d3.scaleOrdinal` for color mapping, and `d3.axisBottom` with gridlines for the percentage axis. Data comes from the included `data.csv` file, and the SVG rendering is driven by D3’s data-join pattern.
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