Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Making a Bar Chart

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed