Learn how to use the DC reduce() function to create a stacked bar chart. Explore reduceAdd(), reduceRemove(), and reduceInitial().
- [Instructor] We've already seen stack with an area chart,…but in that case,…we were stacking two different fields, total and tip.…What if we wanted to split one field up in two ways?…Well, that's what this stacked bar chart does.…Here's one I've prepared earlier.…And you can see the total spend in our payments on cash,…I think was 330, but in this stacked bar,…we're splitting it into people who dined alone…and people who dined together.…So we're not stacking one field on top of another,…we have split one field up in two ways.…
So we're going to create this now…starting with our bar chart document,…and we'll change that into stackBarChart.…And we can get rid of totalDimension,…because we're going to be using typeDimension,…and modifying them.…So the first thing we can do is make our bar chart…run off of our basic type dimensions.…
So we're going to get our columns right…before we start splitting up our data.…So we're going to have one bar for each payment method,…and payment methods are strings,…so we need an ordinal scale,…
- Downloading and setting up DC.js
- Building dashboards
- Making charts: bar, area, pie, bubble, boxplot, and series
- Applying graphical filtering
- Working with dates
- Restyling dashboards
- Using D3 charts in a DC dashboard
- Linking charts together
Skill Level Intermediate
Crossfilter for Data Science Essential Trainingwith Emma Saunders1h 33m Intermediate
D3.js Essential Training for Data Scientistswith Emma Saunders4h 38m Intermediate
Data Visualization Tips and Trickswith Matt Francis2h 14m Intermediate
1. Preparing to Code in DC
2. Individual Charts
3. Making Advanced Charts
4. Building a Dashboard
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.