Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bar Chart Review

Public visualization

Bar Chart Review

0 stars1🌍 Public
Ccathykan
Last edited May 4, 2020
Created on Apr 28, 2020
Forked from React Starter

This example shows a horizontal bar chart ranking the top 10 most populous countries, with population values on the x-axis and country names on the y-axis. The code uses React with D3 v5, loading data from a CSV file via `d3.csv` and rendering SVG elements. It employs `d3.scaleLinear` and `d3.scaleBand` for positioning, `d3.axisLeft` and `d3.axisBottom` for axes, and custom tick formatting with `d3.format` to abbreviate large numbers (e.g., converting billions to "B"). The bars are drawn via a data join, with a title and axis label added as text elements.

AI-generated description

React Starter code.

Comments

Sign in to join the discussion.

MIT Licensed