🌍 Public
Viewing a saved revision (read-only)
fc45503ec8934371aadf3ea63e525bdf
Making a bar chart
This example shows a horizontal bar chart of country populations, with bars sorted by population and labeled on the y-axis. It uses D3 v5 methods such as `scaleBand` for the categorical axis, `scaleLinear` for the numeric population scale, and the `axisLeft` and `axisBottom` functions to generate the axes. The chart is rendered as SVG, with each bar’s height set by `yScale.bandwidth()` and its width proportional to population, as read from a CSV file and scaled by a factor of 1,000.
AI-generated description