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

Exploring SVG with a pie chart - JavaScript Tutorial

From the course: DC.js for Data Science Essential Training

Start my 1-month free trial

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…

Contents