Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Making a Bar Chart

0 stars4🌍 Public
Llarsboergo
Last edited Feb 10, 2021
Created on Jan 25, 2021
Forked from Let's Make a Face

This example shows a horizontal bar chart of the ten most populous countries, using the `d3.csv` loader to read the data file and the `d3.scaleLinear` and `d3.scaleBand` functions to map population and country names to the SVG canvas. The code builds the visualization by appending a `g` element, adds axes with `d3.axisLeft` and `d3.axisBottom`, and renders the bars as `rect` elements with a steelblue fill. The chart is a static SVG, with the y-axis labeled by country and the x-axis scaled to the population values.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed