Skip to main content
100%

Refactored Bar Chart

✓ Published0🌍 Public
VVeerle
Last edited Nov 20, 2020
Created on Nov 20, 2020

This example displays the top 10 most populous countries as horizontal bars, ranked by population, with country names on the left and a linear population scale on the bottom. Built with React and D3 v5, it uses `scaleBand` for the categorical y-axis, `scaleLinear` for the numeric x-axis, and renders SVG rectangles via the `Marks` component. Axis labels and ticks are generated by `AxisBottom` and `AxisLeft`, which map scales to SVG elements. Data comes from the UN World Population Prospects 2019 CSV, loaded asynchronously with `d3.csv` inside a custom `useData` hook.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.

MIT Licensed

Similar vizzes