Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
陳陳泰元
Last edited Sep 30, 2022
Created on Sep 30, 2022
Forked from Make a face

This example demonstrates how to build a simple horizontal bar chart using D3 v7, displaying population data for ten countries from a CSV file. The chart shows each country’s population as a steelblue rectangle, scaled linearly along the x-axis and positioned by a band scale on the y-axis. The code uses D3 modules like `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom`, rendering SVG elements within a 960x500 viewport. Population values are converted from thousands to actual counts before being passed to the scales.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes