Skip to main content
100%

Axes Barchart with react and D3

✓ Published1🌍 Public
GGokulkrishnan1996
Last edited Jul 8, 2022
Created on Jul 8, 2022
Forked from Margin Barchart

This example shows a horizontal bar chart of the top ten countries by 2020 population, with labeled axes rendered as custom SVG elements. The React app fetches UN population data via d3.csv, then uses d3.scaleBand for the categorical y-axis and d3.scaleLinear for the numeric x-axis. Tick marks and labels are generated manually from xScale.ticks() and yScale.domain(), while d3.max determines the scale domain. The chart renders through React’s useState and useEffect hooks, producing an interactive SVG visualization inside a React-DOM root.

AI-generated description

program follows circle

MIT Licensed

Similar vizzes