Creating a Line Graph with JSON Data

This example will explain how to use D3's request methods to retrieve asynchronis data and then create a line graph. The data will come from Githubs API and will consist of the number of commits by all users in the last 52 weeks on a specific library. Some of the code for the line graph was sourced from d3noob.org, but modified for this example. I highly encourage you to take a look at the original graph and the other tutorials on d3noob.

Getting Data

Data can be sorced locally or you can retrieve it from an external website by making an ()request. D3 works with many data formats and has built in request methods to specifically retrieve certain formats. The data that we will be using in this example is a JSON object.