🌍 Public
Viewing a saved revision (read-only)
199517177bef463189d8804aed2ba051
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