Skip to main content
100%

The Margin Convention

✓ Published1🌍 Public
GGayan Priyadarshana
Last edited Jul 31, 2023
Created on Jul 31, 2023

This example demonstrates a bar chart of stock closing prices using the margin convention, where a React component manages the loaded CSV data via `useState` and `useEffect`. The chart maps product names to a `d3.scaleBand` y-axis and closing values to a `d3.scaleLinear` x-axis, rendering SVG rectangles. Data is fetched asynchronously with `d3.csv` and limited to the first ten rows. A fixed margin of 20 pixels on each side defines the inner plotting area, with axes translated to that offset.

AI-generated description

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

Trying to create a line graph using the real data set.

MIT Licensed

Similar vizzes