Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
EEzhil-Kalai
Last edited Feb 26, 2023
Created on Feb 25, 2023

This example creates a horizontal bar chart of country populations using React and D3 v7, rendering to SVG. It loads data from a CSV file and uses `d3.scaleLinear` and `d3.scaleBand` to map population values and country names to positions, with `d3.axisLeft` and `d3.axisBottom` generating the axes. The bars are drawn as `rect` elements appended to a grouped SVG container.

AI-generated description

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

See also React Starter.

MIT Licensed

Similar vizzes