Making a Bar Chart
✓ Published1🌍 Public
This example shows a horizontal bar chart of country populations, using a linear scale for population values and a band scale for country names, with bars drawn as SVG rectangles. The code loads data from a CSV file, parses population numbers, and renders axes with D3’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` functions. Bars are filled with a steel-blue color via CSS, and the chart is drawn entirely with SVG elements inside a fixed-size canvas.
AI-generated descriptionMIT Licensed