Activity6_q1.2
✓ Published0🌍 Public
This example shows a horizontal bar chart of population data for 20 countries in 2010, using a linear scale for population values and a band scale for country names. The code loads data from a remote CSV file and renders the chart as an SVG in a React component, using D3 v5 APIs such as `scaleBand`, `scaleLinear`, and `csv`. Interactive tooltips display the formatted population on hover, while axis labels and tick formatting convert values to billions using `format('.2s')`.
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