Simple Difference Chart
A simple difference chart visualizes the daily change in Leanpub book downloads for two titles, "Science" versus "Style," from April to June 2015. The chart uses D3.js version 3.5.5 with SVG rendering, employing `d3.svg.area` and `d3.svg.line` to show two time-series lines and a filled region indicating the difference between them. The data is loaded from a CSV file using `d3.csv`, then restructured with `d3.nest` to compute daily differences. The area is colored differently above and below zero using clip paths.
AI-generated descriptionThe graph above shows a simple example of a difference chart used as an example in the book D3 Tips and Tricks. It is based on the difference chart example produced by Mike Bostock.
The graph shows the difference in the number of daily downloads between R Programming for Data Science by Roger Peng and The Elements of Data Analytic Style by Jeff Leek
There is an explanation of the code available in D3 Tips and Tricks