This video covers how to create an ordinal scale and axis using it.
- [Instructor] So far, we've seen two types of scale,…linear and time.…Both of these are types of Continuous Scale.…In fact, there are three other categories of scale in D3,…ordinal, quantize, and sequential.…In this section, we're going to look at ordinal scales.…Ordinal scales contain category labels.…Imagine an axis that has the days of the week…from Monday to Friday.…Ordinal axes display strings that are passed to them…rather than calculating a value,…like numerical or time axes do.…
So you can close down area.js…and open up shapes.js that we used previously…and re-reference your HTML file to shapes.js…and just check that that's all worked correctly,…which it has.…What we're going to do is add an X-axis…to the bar chart here using ordinal labels.…So the first thing that we need to do…is create your array of labels,…which I'm going to call dataDays,…and its three string values,…and I'm going to call it Mon, Wed, and Fri.…
Next, we define our X scale which is, this time,…d3.scaleOrdinal and, just like before,…it takes domain and range but as we're going to see,…
- Making a simple bar chart with D3
- Understanding SVG graphics
- Drawing basic shapes
- Adding text
- Using generators and the path element
- Creating a scale and axes
- Importing data into D3
- Creating trees and Voronoi tessellations
- Preparing your data for advanced graphics
- Adding interactivity and transitions
- Choosing the right graphic
- Finding D3.js plugins
Skill Level Intermediate
2. Making a Simple Bar Chart with D3
3. Basic Shapes, Courtesy of SVG
4. Advanced Shapes, with D3 and Path
5. Scales and Axes
6. Importing Data into D3
7. Additional Graphics with D3 Layout
8. Preparing Your Data for Advanced Graphics
10. Picking the Right Graphic
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.