Skip to main content
100%

Axes with React & D3

✓ Published1🌍 Public
PPeter Krevenets
Last edited Mar 14, 2021
Created on Mar 14, 2021

A horizontal bar chart displays the 11 most populous countries in 2020, using United Nations World Population Data 2019. React manages the component state, loading the CSV via `d3.csv` and sorting/slicing the data. D3’s `scaleBand` and `scaleLinear` position the bars, while custom SVG groups render tomato-colored gridlines and axis tick labels from `xScale.ticks()`. All marks are drawn as SVG elements within a translated `<g>` group, using margins to align the chart.

AI-generated description

Using United Nations World Population Data 2019 and React to render a bar chart with margins.

MIT Licensed

Similar vizzes