Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

366ab430dcea4c86b666fcf3d562f316

Making a Bar Chart

0 stars1🌍 Public
TTsen Hsieh
Last edited Nov 6, 2022
Created on Sep 27, 2022

This example presents a horizontal bar chart of population counts for eight countries, drawn as SVG rectangles. The chart uses D3 v7's `scaleLinear` and `scaleBand` to map population values and country names to positions, with axes formatted using `format` and custom tick labels. Data is loaded from a CSV file via `csv()`, and the bars are rendered by appending `rect` elements to an SVG group.

AI-generated description