Skip to main content
100%

Making a bar chart

✓ Published0🌍 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
MIT Licensed

Similar vizzes