🌍 Public
Viewing a saved revision (read-only)
1a6da13b7fb043fb8c126d75243d5b34
activity6question-1
This example shows a horizontal bar chart comparing the populations of ten countries from the year 2000, with a green bar representing each country’s population in millions. The visualization uses React to render SVG elements, with D3’s `scaleBand` and `scaleLinear` defining the y- and x-axes, respectively. Data is loaded from a remote CSV file using D3’s `csv` method, and axis labels are formatted using D3’s `format` function to abbreviate values (e.g., converting billions to "B"). Tooltips provide exact population values on hover via the SVG `title` element.
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.