Creating Bins

The ‘d3.bin()’ function will help us with formatting our data into distributed buckets.

Let’s use the d3.bin() function to help us create bins. It is going to help us format our data. Let’s pick up where we left off.

The d3.bin() function

We will write the code for the bins below the xScale variable in the script section.

Get hands-on with 1200+ tech skills courses.