Skip to main content
100%

Making a Bar Chart

✓ Published2🌍 Public
Yyktan89
Last edited Jan 14, 2020
Created on Dec 30, 2019

This bar chart displays population figures for 18 countries, with each bar’s length representing population in thousands and countries ordered along the vertical axis. The visualization uses D3 v5’s `scaleLinear` and `scaleBand` to map data to pixel coordinates, while `axisLeft` and `axisBottom` generate the labeled axes. Population data is loaded from a CSV file via `d3.csv`, and rectangles are appended to an SVG canvas, styled with a purple fill. The chart’s margins and inner dimensions are computed dynamically from the SVG’s width and height attributes.

AI-generated description
MIT Licensed

Similar vizzes