🌍 Public
Viewing a saved revision (read-only)
1b692642d5124efaa79b76aa2a2e9d62
Activity 6 Question 1-2
This example displays a horizontal bar chart comparing the 2010 populations of twenty countries, sorted by the country name along the y-axis and population magnitude along the x-axis. Built with React and rendered as an SVG, the chart uses d3's `scaleBand` and `scaleLinear` to position bars and axes, with `d3.format` shortened to billion units for tick labels. Population data is loaded from a CSV file via d3's `csv` function, with each bar’s tooltip showing the formatted 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.