Skip to main content
Public

Share visualization

Loading preview…

Axes with React & D3

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Axes with React & D3

1
Sstephanie0215
Last edited Sep 29, 2022
Created on Sep 29, 2022

This example demonstrates a bar chart with axes built using React and D3 v7. It loads UN population data from a CSV file using `d3.csv`, then renders an SVG with a linear x-axis and a banded y-axis. React hooks like `useState` and `useEffect` manage the asynchronous data loading and component state. The chart displays tick marks, rotated labels, and population values as rectangles, with all axes drawn manually using SVG line and text elements. Data is sliced to the top 10 countries and rendered with a fixed margin layout.

AI-generated description

A program that loads in some data using D3 utilities, and uses REACT state to keep track of the data.

Comments

Sign in to join the discussion.

MIT Licensed