Skip to main content
100%

Making a Bar Chart

✓ Published0🌍 Public
Jjerz-0788
Last edited Jun 3, 2020
Created on Jun 2, 2020
Forked from Making a Bar Chart

This example demonstrates how to build a simple, horizontal bar chart using D3 v5 and SVG. It displays population data for ten countries, with bars sized proportionally to each nation’s population in thousands. The code uses `d3.csv` to load the data, then applies `scaleLinear` for the x-axis and `scaleBand` for the y-axis to position and size the rectangles. The chart is rendered entirely with SVG `<rect>` elements, with the population values converted to numbers before scaling.

AI-generated description
MIT Licensed

Similar vizzes