Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

bar_chart

Public visualization

bar_chart

0 stars0🌍 Public
Ssagar limbu
Last edited Aug 22, 2022
Created on May 30, 2022
Forked from React Starter

This example shows a horizontal bar chart displaying the top 10 countries by population in 2020, based on data from a UN population CSV file. The chart uses React with hooks to load and process the data, and renders bars as SVG rectangles scaled with D3’s `scaleLinear` and `scaleBand`. Axis ticks are drawn using D3’s `ticks()` method, and both countries and population values are labeled directly within the visualization. The bars are vertically centered on each band using the scale’s `bandwidth()` function.

AI-generated description

React Starter code.

Comments

Sign in to join the discussion.

MIT Licensed