Skip to main content
100%

Ep 24 Bar Chart ReactD3 Styliazed

✓ Published1🌍 Public
GGordon Yang
Last edited Apr 14, 2021
Created on Apr 8, 2021

This example shows a horizontal bar chart displaying the top 10 countries by population for the year 2020, drawn using React and D3 v6. The SVG-based visualization uses `scaleBand` for the categorical y-axis and `scaleLinear` for the numeric x-axis, with custom `AxisBottom`, `AxisLeft`, and `Marks` components. Population values are formatted using D3’s `format` function, converting values like "1.4B" for billions, and data is loaded from a CSV file via `d3.csv`. The chart features a Poppins font, styled gridlines, and tooltips showing the formatted population for each country on hover.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes