Travail : Stacked bar chart v4
This stacked bar chart, built with D3 v4, visualizes monthly closing prices for a single stock symbol (MSFT) over time, with each bar segmented by category. The visualization uses an SVG canvas and loads its data from a CSV file containing 216 monthly price observations spanning January 2000 through December 2008. The chart employs a linear y-scale and a band x-scale with 10 evenly spaced groups, while a categorical ordinal color scale assigns distinct colors to up to seven stacked series. The data is processed using d3.nest() to structure the records by symbol, then passed to d3.stack() to compute the cumulative y-positions for each bar segment. Although the code is written generically for multiple series and symbols, the included data contains only one symbol (MSFT), so the resulting chart displays stacked bars representing monthly price values, with the x-axis representing time samples and the y-axis representing the accumulated stock price. The visualization uses a muted color palette and SVG rendering, with axes that omit the domain line for a cleaner look.
AI-generated descriptionBuilt with blockbuilder.org
forked from <a href='http://bl.ocks.org/romsson/'>romsson</a>'s block: <a href='http://bl.ocks.org/romsson/8aea86fddcf01380eb96a341509f394f'>Stacked bar chart v4</a>