Multi-line graph 4: Toggle
This multi-line graph displays monthly stock price data for Microsoft, Amazon, and IBM from January 2000 to March 2010. It demonstrates an interactive toggle feature where clicking a company name in the legend fades its corresponding line in or out using a 100-millisecond opacity transition. The visualization is built with D3 version 3, using `d3.svg.line` for path generation, `d3.svg.axis` for axes, and `d3.nest` to group data by symbol from the provided stocks.csv file.
AI-generated descriptionThis is a derivative of the simple d3.js graph used as an example in the book D3 Tips and Tricks. The stock data was sourced from Mike Bostock's small multiples example.
It is the fourth graph in a series that is building a multi-line graph that incorperates an automatically developed legend and a system that can toggle the lines off and on as desired.
This version is demonstrating the ability to toggle the lines off and on by clicking on the appropriate legend text.
The graph should be taken in context with the text of the book which can be downloaded for free from Leanpub.