Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
JJustin Gieselbach
Last edited Mar 17, 2020
Created on Mar 17, 2020
Forked from Making a Bar Chart

This example shows a horizontal bar chart of population counts for twelve countries, with each bar’s length scaled linearly and country labels aligned on the vertical axis. The visualization uses D3 v5 APIs including `scaleLinear`, `scaleBand`, `axisLeft`, `axisBottom`, and `selectAll().data().enter().append()` to render SVG rectangles. Data is loaded from a CSV file via `d3.csv`, with population values converted from numeric strings to numbers by multiplying by 1000. The chart applies fixed margins and transforms to position axes and bars within an SVG container.

AI-generated description
MIT Licensed

Similar vizzes