Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of bar chart of stock market with react and d3

Public visualization

Fork of bar chart of stock market with react and d3

0 stars1🌍 Public
Mmeghshah612
Last edited Feb 20, 2022
Created on Feb 20, 2022

This example visualizes the dividend yields of the top 12 companies from a CSV dataset, rendering a horizontal bar chart in SVG. The React component fetches and parses the data with `d3.csv`, then uses `scaleBand` for the categorical y-axis and `scaleLinear` for the numeric x-axis. D3’s `ticks()` generates the axis gridlines and labels, while the bars are drawn as `<rect>` elements sized by the dividend values. The chart includes margins and axes, with data loaded asynchronously and displayed after a brief "Loading" state.

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