From the course: DC.js for Data Science Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Exploring SVG with a pie chart - JavaScript Tutorial
From the course: DC.js for Data Science Essential Training
Exploring SVG with a pie chart
- [Instructor] A pie chart shows you relative proportions, and contrary to some beliefs, they generally work better with fewer categories. So, we're going to create a pie chart looking at payment method, which is tab cash in Visa. So, just three categories. So, we can save a copy of our file, and update our... References. and we can keep our div just the same. So now, let's look at stage two, which is our Crossfilter data. I want to see how total payments split by payment type. So I can use the existing type dimension that we used for our first bar chart and then type group needs to return me the total payment which it already does. Now, we can change line charts into pie charts which is just good practice really but this one's the important one, dc.piechart. And we can get rid of ticks cause we're not going to have any axes and we can delete a whole bunch of parameters. We don't want stack, we can get rid of the second, optional second parameter. We don't want grid lines, they're…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Making a bar chart11m 5s
-
(Locked)
Modifying our bar chart15m 57s
-
(Locked)
Working with dates to make a line or area chart15m 28s
-
(Locked)
Making a stack area chart with legend3m 43s
-
(Locked)
Exploring SVG with a pie chart13m 13s
-
(Locked)
Making a scatter plot9m 29s
-
(Locked)
Making a bubble chart13m 28s
-
(Locked)
Making a data table with bootstrap17m 46s
-
(Locked)
Understanding common attributes5m 25s
-
-
-
-