task2
✓ Published1🌍 Public
This example presents a stacked horizontal bar chart titled "Most viewed sports," visualizing the percentage distribution of ratings across six sports (Football, Basketball, Cricket, Tennis, Golf, Athletics) using five rating categories from a CSV file. The chart uses `d3.scaleOrdinal` for color mapping and `d3.scaleBand` for the category axis, with `d3.stack` to aggregate the percentage data. Interactive tooltips display exact percentage values on mouseover, and the SVG rendering employs `d3.axisBottom` for the x-axis and custom styling from 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