Histograms

Learn how to draw histograms for data visualization in D3.

What are histograms

A histogram is a graphical representation of the distribution of numerical data. It is typically formed by creating “bins” of a larger dataset that group the data into a range of values and count the number of pieces of data that fall into each bin. Each bin is then represented as a bar showing the relationship between each range.

The example we will work through shows the frequency of earthquakes above magnitude 3 between July 2010 and January 2012 in Christchurch, New Zealand (a time of some significant seismic activity). Data was sourced from New Zealand’s Geonet site.

Get hands-on with 1200+ tech skills courses.