Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

9b152d5e7a004b8eb98e565054cbde10

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