Welcome to d3aday! If this is your first time, we recommend reading the about page before jumping in.
The Inspiration
A “streamgraph” is a stacked area graph centered along a horizontal axis (generally a timeline), giving it a flowy, streamy feel. And compared to the more traditional stacked columns, it can be easier to compare across categories.
In this exercise we’ll crete a streamgraph, taking inspiration from a graph of subreddit comments by Nathan Yau on Flowing Data.
The Exercise
It may be helpful to try your hand at a stacked bar chart first, if you haven’t done one already.
I encourage you to carefully digest the documentation on stacks, and sort through a few examples. I particularly like these:
Also helpful is this page on D3 color schemes. I think it’s important to get color right on these.
For the data, instead of using reddit comment data I pulled from Stack Exchange - in particular, trends in questions that had data-visualization-related tags. This seemed like a fun way to roughly gauge popularity of some different tools in the space.
Along the way I discovered the Stack Exchange data repository, which is an amazing site that actually lets you write and run SQL queries against its dataset, right there on the page. In addition, you can search other users’ queries and fork them to jumpstart your own.
Which is exactly what I did to get the data for this exercise. You can find my query here.
A Solution
My solution is shown below. As usual I simplified things a bit, since it’s designed to be an exercise only, but tried to keep the essential features.