🌍 Public
Viewing a saved revision (read-only)
7fa2fec05c5e41aaae882bc77ba18d49
Making a Bar chart using D3.js
This example shows a horizontal bar chart of country populations using D3.js v5, with each bar’s length scaled linearly to the population value and country names on the y-axis. The SVG rendering uses `d3.scaleLinear` for the x-axis, `d3.scaleBand` for the categorical y-axis, and `d3.axisBottom` and `d3.axisLeft` to draw the axes. Data is loaded asynchronously from a CSV file, with population values converted from thousands to raw counts. Bars are appended as `rect` elements and styled with steelblue fill via CSS.
AI-generated descriptionA bare minimum HTML page.