🌍 Public
Viewing a saved revision (read-only)
422ce713af2a420f8f9c7cd47ca180db
Activity 7
This example shows a horizontal bar chart ranking 20 countries by their 2020 population, with the data loaded from a CSV file and rendered as SVG. The React-based code uses D3 v5’s `scaleBand`, `scaleLinear`, `csv`, and `max` to map country names to rows and population values to bar widths, while custom `AxisBottom` and `AxisLeft` components generate ticks and labels. Bars are drawn as colored rectangles with tooltips showing formatted population values.
AI-generated descriptionA demonstration of how to start using D3 version 6.