Skip to main content
100%

Styling of Bar Graph

✓ Published0🌍 Public
Sshresthabhi
Last edited Oct 18, 2021
Created on Oct 18, 2021
Forked from Margin and Axes

This example shows a horizontal bar graph comparing the population of ten countries, using a dataset loaded from a GitHub gist. The graph renders as an SVG in React, with bars and axes created through React components. It uses D3’s `scaleBand` for the categorical y-axis and `scaleLinear` for the quantitative x-axis, along with `max` to compute the scale domain. The `csv` function from D3 loads and parses the data, which is managed with React’s `useState` and `useEffect` hooks.

AI-generated description

React Starter code.

MIT Licensed

Similar vizzes