🌍 Public
Viewing a saved revision (read-only)
1c833239811c4c8bb2c4c69e473d4b43
Making a Bar Chart
This example shows a horizontal bar chart of the ten most populous countries in 2017, with population values (in thousands) drawn from a local CSV file. The chart renders as SVG using D3 v5, where the x-axis scale is linear and the y-axis uses a band scale with left-aligned axis labels. The code explicitly constructs the visualization with `select`, `csv`, `scaleLinear`, `scaleBand`, and `axisLeft` from the D3 library, then maps each country’s population to the rectangle’s width and country name to its vertical position.
AI-generated description