Course lesson

Create a Color Scale with D3's scaleOrdinal

In this lesson, we'll clean up some of our placeholder elements. We'll then look at D3's ordinal scale to create a color scale that maps our regions to colors. We'll apply the colors based on region to our data points via the SVG g(group) element to apply the...

Duration
2 min
Access
Included
Transcript
Retained from source evidence

In this lesson, we'll clean up some of our placeholder elements. We'll then look at D3's ordinal scale to create a color scale that maps our regions to colors. We'll apply the colors based on region to our data points via the SVG g(group) element to apply the color to both our bars and their corresponding inline labels.