Skip to main content
100%

Styled Bar Chart woth React & D3

✓ Published2🌍 Public
Bbassra
Last edited Jan 14, 2023
Created on Jan 12, 2023

This example shows a horizontal bar chart of the top 10 countries by population in 2020, with each bar labeled with its country name and a formatted x-axis displaying population in billions. The React components `Marks`, `AxisBottom`, and `AxisLeft` render SVG rectangles and tick marks, while the custom `useData` hook fetches the CSV via `d3.csv` from a GitHub gist. Styling uses CSS classes with the Poppins font, and D3’s `scaleBand` and `scaleLinear` handle the coordinate mappings, with `d3.format` applied to abbreviate tick labels.

AI-generated description

A Styled bar chart with React & d3.

MIT Licensed

Similar vizzes