Skip to main content
Public

Share visualization

Loading preview…

Bar Chart 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

Bar Chart with React & D3

0
Kkirangithub23
Last edited Jun 26, 2022
Created on Jun 26, 2022

A bar chart displays the Grades of the top 10 students, with student names on the y-axis and grade values on the x-axis. The visualization uses React hooks (`useState`, `useEffect`) to fetch CSV data asynchronously from a GitHub URL, then renders SVG rectangles scaled with `d3.scaleBand` and `d3.scaleLinear`. Axes are manually constructed from tick values, with grid lines drawn using SVG `<line>` elements. D3 v5 and React 16.9 are loaded via UMD scripts, and the chart updates reactively once data arrives.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed