Skip to main content
100%

Making a Bar Chart!

✓ Published1🌍 Public
Llars-ruijs
Last edited Nov 3, 2020
Created on Nov 3, 2020
Forked from Let's make a Face!

This example shows a horizontal bar chart of country populations using a dataset loaded from a CSV file. The chart maps population values to bar widths with `d3.scaleLinear` and country names to vertical bands with `d3.scaleBand`, rendering SVG rectangles. Axes are added using `d3.axisLeft` and `d3.axisBottom`, while the code imports these functions from D3 v6 and handles the data with `d3.csv`. Population values are multiplied by 1,000 on load, and the chart is styled with a simple CSS rule for blue bars.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes