Skip to main content
Public

Share visualization

Loading preview…

Making a bar chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Making a bar chart

0
Nnouralkhoury
Last edited Sep 28, 2020
Created on Sep 28, 2020
Forked from Making a bar chart

This example shows a horizontal bar chart ranking the world’s ten most populous countries, with population values labeled in billions and a steel-blue fill for each bar. It uses D3 v5’s `csv` loader to import data, `scaleLinear` and `scaleBand` for positioning, and `axisBottom` with a custom tick formatter that converts G to B. The SVG rendering includes margins, a title, and an axis label, demonstrating core DOM manipulation through `select` and `append`.

AI-generated description

Demonstrates fundamental DOM manipulation using D3.js by making a smiley face whose eyebrows move.

Comments

Sign in to join the discussion.

MIT Licensed