🌍 Public
Viewing a saved revision (read-only)
d02030f1b1004fa48b085c27d8bb4812
activity6_task1_question1
This example uses a horizontal bar chart to display the top 10 countries by population in the year 2000. The chart, built with React and rendered as SVG, uses D3 v5 utilities like `scaleBand` and `scaleLinear` to map country names and population values to screen coordinates. Each bar’s length corresponds to the population value, with a tooltip showing the formatted number. Data is loaded from a remote CSV file via D3’s `csv` function, and the x-axis labels are customized using D3’s `format` to abbreviate large numbers.
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.