Band Scales

The band scale was introduced for helping us space out bars across an x-axis.

We are going to learn a new scale called a band scale. We will talk about it in a moment, but first, let’s create a scale for the y-axis. The y-axis will measure the population. We are going to use a linear scale for the y-axis.

Before getting started, remove the console statement for the stackData variable if you are working locally. We don’t need it anymore.

Linear scale

We will create a variable called yScale. Its value will be the d3.scaleLinear() function.

Get hands-on with 1200+ tech skills courses.