Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Making a Bar Chart

0 stars0🌍 Public
Pprat1507
Last edited Aug 28, 2019
Created on Aug 28, 2019

This example shows a horizontal bar chart ranking countries by population, using a CSV dataset of ten nations. The bars are rendered as SVG rectangles, with each country’s population scaled linearly across the chart width and country names positioned along a band scale. The code loads data with `d3.csv`, converts population values to thousands, and builds the chart using `d3.scaleLinear`, `d3.scaleBand`, and `d3.max` for domain calculation.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed