🌍 Public
Viewing a saved revision (read-only)
58492552d3974a1f84cb2f9aa48d6328
Activity 6_Question 1.2
This horizontal bar chart displays the population of 20 countries in 2010, sorted by country name, with bars extending from a shared left baseline. The visualization is built with React and D3 v5, using `scaleBand` for the categorical y-axis and `scaleLinear` for the quantitative x-axis. Population values are loaded from a remote CSV file via `d3.csv`, formatted with `format('.2s')` to show abbreviated labels like “1.2B”, and rendered as SVG rectangles with native tooltips. The code includes reusable axis components and applies a green fill to the bars.
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.