Activity 6_Task 1 Question 1.2
✓ Published0🌍 Public
This example displays a horizontal bar chart of the top 20 most populous countries in 2010, using a categorical y-axis for country names and a linear x-axis for population values. The visualization is built with React and D3 v5, where the `scaleBand` and `scaleLinear` functions handle axis scaling, while custom SVG components (`AxisBottom`, `AxisLeft`, and `Marks`) render ticks and rectangle bars. Data is loaded asynchronously from a remote CSV file via D3’s `csv` function, and tooltips are provided through SVG `<title>` elements. The chart includes styled axes, labels, and a title, with formatting that abbreviates large numbers (e.g., “B” for billions).
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.
MIT Licensed