🌍 Public
Viewing a saved revision (read-only)
103a6e9b8aa942239af64adcf2b558f8
Activity 6_2000
This example displays a horizontal bar chart comparing the populations of the top 10 countries in the year 2000, with country names on the y-axis and population totals on the x-axis. The chart is rendered as an SVG using React components, with scales created via d3.scaleBand and d3.scaleLinear. Data is loaded from a CSV file using d3.csv, and axis ticks are formatted with d3.format to abbreviate large numbers (e.g., converting billions to "B"). Hovering over a bar reveals a tooltip with the exact population value.
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.