Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
ÁÁlvaro Cáceres Muñoz
Last edited Feb 13, 2021
Created on Feb 12, 2021

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 description
MIT Licensed

Similar vizzes