Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Styling of Bar Graph

Public visualization

Viewing a saved revision (read-only)

ace43dc5729243028679d676bb1396dc

Styling of Bar Graph

0 stars0🌍 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.