2020-stock-returns
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 descriptionBased 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.