Skip to main content
Public

Share visualization

Loading preview…

D3 Course 1: 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

D3 Course 1: Bar Chart

1
支支良
Last edited Mar 29, 2020
Created on Mar 29, 2020

This example shows a bar chart comparing population totals for ten countries, drawn as an SVG with a linear scale for population and a band scale for country names. The render function builds axes, labels, and rectangular bars using D3 v5 APIs including `scaleLinear`, `scaleBand`, `axisBottom`, `axisLeft`, and `selectAll`/`enter`. It loads data from a local CSV file via `d3.csv`, multiplies each population value by 1000, and displays the result with formatted tick labels. The chart includes a title, axis labels, and a steel-blue fill for each bar.

AI-generated description

Data Visualization with D3 course; Bar Chart

Comments

Sign in to join the discussion.

MIT Licensed