🌍 Public
Viewing a saved revision (read-only)
6d4e96b6628140b4aa1e00a055a8c0e5
D3 Bar Chart with Axes
This example shows a horizontal bar chart of the top 10 countries by projected 2020 population, with country names on the y-axis and population counts on the x-axis. The chart uses React to manage state and the D3 v7 library’s `csv` loader to fetch United Nations population data from a GitHub gist. Scales are created with `scaleBand` and `scaleLinear`, while axes are drawn manually using SVG `<line>` and `<text>` elements, with gridlines derived from `xScale.ticks()`.
AI-generated descriptionHalf way towards a smiley face.