Skip to main content
100%

Stacked to Grouped

✓ Published0🌍 Public
BBaptisteL54
Last edited Feb 2, 2018
Created on Feb 2, 2018

This visualization displays monthly stock prices for four companies (MSFT, AMZN, IBM, AAPL) across selected years, initially rendered as stacked bars and toggling to grouped bars when a white circle is clicked. The code uses D3 v4 with SVG rendering, loading data from `stocks.csv` via `d3.csv`. It builds linear scales (`d3.scaleLinear`) for positioning and creates rectangles for each bar, with colors distinguishing companies. The chart updates by re-binding data and adjusting bar widths and heights, and includes labeled axes and a company legend.

AI-generated description

Built with blockbuilder.org

mit Licensed

Similar vizzes