Skip to main content
Public

Share visualization

Loading preview…

Reproducing the 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

Reproducing the Bar Chart

2
WWaseem Medhat
Last edited Oct 20, 2020
Created on Oct 20, 2020
Forked from HTML Starter

This example reproduces a bar chart ranking the ten most populous countries in 2020, sourced from the United Nations World Population Prospects 2019. It shows horizontal bars of varying lengths with a zero line, axis ticks, and a population title, using React components for rendering to SVG. The code employs D3 v6 scales (`scaleBand`, `scaleLinear`) for positioning, D3’s `format` for tick labels, and `csv` for data loading. Custom React components (`AxisBottom`, `AxisLeft`, `Marks`, `ZeroLine`) manage the visualization layout and styling.

AI-generated description

Replicating from scratch the bar chart created in Datavis 2020 (episodes 21-24).

Comments

Sign in to join the discussion.

MIT Licensed