Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
Mmatthewfresh
Last edited Mar 16, 2020
Created on Mar 16, 2020

This example shows a horizontal bar chart ranking the ten most populous countries, with each bar’s length proportional to population and countries ordered along the y-axis. The visualization uses D3 v5’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to position bars and axes, while `csv()` loads the data and `selectAll` appends SVG rectangles. Population values are multiplied by 1000, and the chart is rendered in an SVG canvas with steelblue bars.

AI-generated description
MIT Licensed

Similar vizzes