Skip to main content
100%

Making a bar chart

✓ Published1🌍 Public
NNkwachi Abel
Last edited Jun 12, 2022
Created on May 23, 2022

This example shows a horizontal bar chart of population counts for the top 10 most populous countries, using data from a CSV file. The bars are rendered as SVG rectangles, with a linear scale mapping population to bar width and a band scale for country labels. The code uses D3 v5 functions including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom`, with tick labels formatted via `format('.3s')`. A React starter template is referenced, though the visible implementation uses plain D3 with an SVG container.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes