Skip to main content
100%

2020-stock-returns

✓ Published0🌍 Public
11wheel
Last edited Jun 13, 2020
Created on Jun 13, 2020

A diverging bar chart compares stock returns for 30 major companies during 2020. Each company is represented by a horizontal bar, colored with `d3.interpolateTurbo` and sized by market capitalization. A brush control lets users scrub through the time series, updating the bars to show returns between any two dates. Built with `d3.brushX` and `d3.select`, the chart loads closing prices from a CSV via `d3.loadData` and renders as a static SVG with animated transitions.

AI-generated description

Based on a McKinsey chart.

I've added a brush and removed the bar height transition so you can scrub through the time series a little faster. It's a little jittery; adding a bit of momentum to the y position might help.

Closing prices from Google Finance, dividends and corporate actions might change returns.

Similar vizzes