Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Let's make a bar chart

Public visualization

Let's make a bar chart

0 stars3🌍 Public
Aalicjakot
Last edited Mar 21, 2020
Created on Mar 21, 2020

This example shows a horizontal bar chart of population figures for eight countries, with the bars sorted alphabetically by country name. The chart is rendered as an SVG using D3 v5. The code loads population data from a CSV file via `d3.csv`, then scales values with `d3.scaleLinear` for the x-axis and `d3.scaleBand` for the y-axis. Axes are drawn using `d3.axisLeft` and `d3.axisBottom`, and each bar is appended as a `rect` element.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed