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
Ffaquora
Last edited Apr 28, 2020
Created on Apr 24, 2020

This example shows a horizontal bar chart of population by country, ranking the ten most populous nations from China to Mexico. It uses d3.csv to load the data, d3.scaleLinear for the x-axis population scale, and d3.scaleBand for the categorical y-axis. The chart renders as SVG rectangles with steelblue fill, with d3.axisLeft and d3.axisBottom providing labeled scales. Margins and a group transform position the plot, while the population values are multiplied by 1000 to reflect full counts.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed