Q2_Activity8
✓ Published0🌍 Public
This interactive bar chart displays the populations of 20 countries in 2010, using a horizontal layout with the y-axis listing country names and the x-axis encoding population scale. The visualization is built with React and D3 v5, relying on D3’s `scaleBand` and `scaleLinear` for positioning and scaling, with SVG rectangles rendered for each bar. Data is loaded via a CSV file using D3’s `csv` function, with population values converted from thousands. The chart includes an x-axis bottom tick label and a y-axis with domain ticks, styled with blue lines and light green bars that show a tooltip on hover.
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