Skip to main content
100%

axis -making bar chart with react ad d3

✓ Published0🌍 Public
Wwzhang88
Last edited Nov 21, 2021
Created on Nov 21, 2021

This example shows a horizontal bar chart of population data for the ten most populous countries in the year 2000, loaded from a CSV file hosted on GitHub. The visualization uses React hooks, specifically `useState` and `useEffect`, to fetch and store the data, while rendering SVG elements for the bars. D3 v5’s `scaleBand` and `scaleLinear` map country names and population values to pixel coordinates, and custom tick marks for both axes are generated by iterating over `xScale.ticks()` and `yScale.domain()` rather than using d3.axis.

AI-generated description

a program that load data and

MIT Licensed

Similar vizzes