🌍 Public
Viewing a saved revision (read-only)
2ae590421bb74815ae28f5658ba9ae21
Activity_6_Task_1_Q1.2
This chart presents a horizontal bar chart comparing the populations of 20 countries in 2010, using D3 v5 within a React framework. The bars are rendered as SVG rectangles, with the country names on the y-axis and a linear population scale on the x-axis; hovering reveals a tooltip with the formatted value. The code builds axes using `scaleBand` and `scaleLinear`, formats tick labels with `format('.2s')`, and loads data via `d3.csv` from a GitHub-hosted CSV file. Styling is applied through CSS classes for marks and gridline ticks.
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.