Skip to main content
Public

Share visualization

Loading preview…

Make 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

Make a bar chart!

1
Mmichielpunt86
Last edited Jul 17, 2020
Created on Jul 16, 2020

A horizontal bar chart displays the population of ten countries, sourced from data.csv, with China and India leading. The SVG chart is built using D3 v5, where `scaleLinear` maps population values to bar widths and `scaleBand` positions each country's bar vertically. The code reads the CSV, multiplies populations by 1000, and appends `rect` elements to the SVG, with bar height derived from the band width.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed