Making a bar chart
✓ Published1🌍 Public
This example shows a horizontal bar chart ranking countries by population, with bars ordered alphabetically along the y-axis and population values on the x-axis. It uses d3.csv to load the data, d3.scaleLinear for the x-scale, d3.scaleBand for the y-scale, and d3.axisLeft and d3.axisBottom to render the axes. The SVG rect elements are filled with steelblue, and the chart is positioned within margins. Population values are converted from thousands to raw numbers before rendering.
AI-generated descriptionMIT Licensed