Skip to main content
Public

Share visualization

Loading preview…

Fork of 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

Fork of Bar Chart

1
Jjlspangl
Last edited May 20, 2021
Created on May 20, 2021
Forked from Bar Chart

This bar chart displays population figures for ten countries, with each bar’s width proportional to its population using a `d3.scaleLinear` for the x-axis and a `d3.scaleBand` for the y-axis to position countries. Data is loaded from a CSV via `d3.csv`, with population values converted from strings to numbers. The chart renders as SVG rectangles inside a fixed 960×500 viewport, using D3 v5’s data join to append elements. The code omits vertical bar positioning, leaving the default y-coordinate, while the x-scale domain spans from zero to the maximum population.

AI-generated description

An example showing the capabilities of VizHub:

Comments

Sign in to join the discussion.

MIT Licensed