Skip to main content
100%

Bar graph

✓ Published1🌍 Public
Mmoosearch
Last edited Oct 3, 2019
Created on Oct 3, 2019

This example shows a horizontal bar chart ranking ten countries by population. The bars are rendered as SVG rectangles and filled with steelblue. The code uses d3.csv to load the data, then applies d3.scaleLinear for the x-axis and d3.scaleBand with padding for the y-axis. The axes are generated with d3.axisLeft and d3.axisBottom. Population values are converted from thousands to actual numbers before rendering, and the chart includes margins around the plotting area.

AI-generated description
MIT Licensed

Similar vizzes