Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Viewing a saved revision (read-only)

fc45503ec8934371aadf3ea63e525bdf

Making a bar chart

0 stars2🌍 Public
Mmla341
Last edited Jun 21, 2020
Created on Jun 20, 2020

This example shows a horizontal bar chart of country populations, with bars sorted by population and labeled on the y-axis. It uses D3 v5 methods such as `scaleBand` for the categorical axis, `scaleLinear` for the numeric population scale, and the `axisLeft` and `axisBottom` functions to generate the axes. The chart is rendered as SVG, with each bar’s height set by `yScale.bandwidth()` and its width proportional to population, as read from a CSV file and scaled by a factor of 1,000.

AI-generated description