Difference Chart
This example shows daily average temperatures in New York and San Francisco over roughly nine months as a bivariate area chart, using clipped SVG areas to color the difference between the two lines: green fills where New York is warmer, and red where San Francisco is warmer. The chart uses D3 v3 with time scale, linear scale, and SVG axes, and two clipped area paths to split the difference region. A black line plots the New York temperature. Data is loaded from a tab-separated file with three columns: date, New York, and San Francisco.
AI-generated descriptionThis variation of a bivariate area chart uses clipping to alternate colors. When New York is warmer than San Francisco, the difference between the two is filled in green. When San Francisco is warmer, the difference is filled in red. A similar technique was used by William Playfair all the way back in 1786.