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
NNirav L. Lekinwala
Last edited May 15, 2020
Created on May 14, 2020
Forked from making bar chart

This example shows a bar chart of country populations, with each bar’s width mapped to population size using a d3.scaleLinear domain from zero to the maximum value. The chart renders as SVG rectangles appended to a 960×500 pixel container, though bar dimensions are fixed at 300×300 pixels regardless of data. The code loads data from a CSV file via d3.csv, parses the population column by multiplying it by 1000, and uses d3.select, d3.max, and d3.scaleLinear from D3 v5.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed