This code example is the result of the Module 6's exercise from the course “Data Visualization
and Infographics with D3,” taught by Alberto Cairo and Scott Murray, and offered through the Knight Center for Journalism in the Americas at UT Austin.
It is a line chart that represents hours of the day of March 20, 2015 along the x axis
using d3.time.scale()
and values of the magnitude of earthquakes on the y axis
using d3.scale.linear()
.
The underlying dataset was filtered to only include earthquakes that occurred in California, so the graph shows earthquakes during the course of the day, separated by magnitude.
Hovering over the dots reveals a tooltip with information of the exact time, magnitude, and geographic region.
Modified http://d3js.org/d3.v3.js to a secure url
https://d3js.org/d3.v3.js