Skip to main content
100%

Difference Chart

✓ Published0🌍 Public
JJeromeMouly
Last edited Oct 10, 2017
Created on Oct 10, 2017

This visualization compares daily average temperatures in New York and San Francisco from 2011 to 2012. Using D3 v4, it renders an SVG area chart where the difference between the two city’s temperatures is filled in orange when New York is warmer and green when San Francisco is warmer. The chart uses `d3.area` with `d3.curveBasis` to smooth the lines, and applies `clipPath` elements to alternate the fill colors based on which city’s temperature is higher. Data is loaded from a TSV file via `d3.tsv`.

AI-generated description

Difference Chart

A v4 update to <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3894205'>Difference Chart</a>

This 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.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/3894205'>Difference Chart</a>

forked from <a href='http://bl.ocks.org/alexmacy/'>alexmacy</a>'s block: <a href='http://bl.ocks.org/alexmacy/67a5211cf2c5cbda74501ce36d85ba4c'>Difference Chart v4</a>

forked from <a href='http://bl.ocks.org/AlainRo/'>AlainRo</a>'s block: <a href='http://bl.ocks.org/AlainRo/a13b672ef688bf238568ca7aa42dde15'>Difference Chart v4</a>

mit Licensed

Similar vizzes