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

1
YYifei Liu
Last edited Aug 26, 2020
Created on Aug 25, 2020

This bar chart displays the population of the top ten most populous countries, using horizontal bars ordered from largest to smallest. The visualization loads data from a CSV file with D3 v5, then uses `scaleLinear` for the x-axis, `scaleBand` for the y-axis, and `axisLeft` and `axisBottom` to render the axes. Rectangles are appended to an SVG container, with their widths scaled proportionally to population values.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed