Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

ca808c4ecbc74ad298368f3149dff5a1

Making a Bar Chart

0 stars0🌍 Public
Cchristoshanes
Last edited Mar 31, 2019
Created on Mar 31, 2019
Forked from Making a Bar Chart

This example demonstrates a basic bar chart that visualizes the populations of ten countries, from China to Mexico, using horizontal bars sorted by descending population size. The chart encodes population values as bar lengths along the x-axis, with country names positioned along the y-axis. Built with D3 v5, the code relies on `scaleLinear` for the numeric x-axis, `scaleBand` for the categorical y-axis, and the `csv` parser to load data from a local CSV file. The bars are rendered as SVG rectangles, with each rectangle’s width and height mapped from the parsed population data.

AI-generated description