Join Ray Villalobos for an in-depth discussion in this video Adding a horizontal guide, part of Data Visualization with D3.js.
- View Offline
…And last video we did the vertical guide, so…now it's obviously time to do the horizontal one.…Now if we make this window a little bit smaller so…we could see a little bit more of what's going on and…I've also turned off the word wrap so that we can see everything in one line.…So, what I need to do is create the other guide so…it's going to look similar to what we've done before.…We'll start by setting up the H or the horizontal axis and…that's going to be pretty much like the vertical one, just a D3 SVG axis.…
Just going to use that method and then we'll set the scale to be the x scale.…So, this, remember, is essentially the scale that we create up here.…This will just give us the numbers of the bottom values here.…So it's going to go form the left,…in this case from zero to the however many bars we have.…So remember the bars vary depending on the amount of data that we have…fed into the system, so right now, there's 50 of them, but there could be more.…
So that's what we're using as the scale.…Next would be the orientation.…
- What is D3.js?
- Creating a basic document structure
- Controlling HTML DOM elements
- Binding data to the DOM
- Drawing SVG graphics with D3
- Using ordinal scales
- Adding events and transitions
- Working with data
- Creating and adjusting layouts