Please subscribe to watch this video
After Effects - Animated Infographic Video & Data Visualisation
Hi there, in this tutorial we're going to make this, where Pie Charts kind of spin around, and pop out a little bit. All right, now let's go and learn how to do this in After Effects.
So, Pie Chart making. Now we don't need Illustrator for this one, which is cool. We're going to make a new project, click on 'File', 'New Project'. And in here, I'm going to go to 'New Composition'. 'HDTV 1080 25', all the same, '5 secs' long. Background color, doesn't matter. And I'm going to click 'OK'. I should have actually named it; I'm going to rename this one, this is going to be called 'Pie Chart 1'. We're going to look at some other things later on when we get into Masking. It's all appended with '1'.
First thing we want to do is put a background in, 'Layer'. If nothing's opening, double click it. Make sure you go to 'Layer', 'New' 'Solid'. Pick a background color, Eyedropper tool, I'm going to pick on gray color. I'm going to rename this one 'Background'. I'm going to lock it. Awesome. Now for this one we're dealing with the data from here. It's the device type for my website, bringyourownlaptop.com 80% of people are using it on their computer, and 14 on Mobile phone, and 6% on Tablet. Obviously our data for our Pie Chart needs to all equal up to 100.
First thing we're going to do is put in our Base Slice. It's going to be the kind of bottom background main chunk. And that's going to represent in our case, the 80%. So let's go and do that. Now I could grab the Ellipse tool up here and draw it. The problem is, the Effect we're going to use requires this Anchor Point to be in the center. And it's a little hard to do with circles. So what we're going to do-- you notice, when I do draw a circle it actually creates a Shape Layer, and puts an Ellipse inside of it. So, what we're going to do is-- I've just deleted that. I'm going to create manually a Shape Layer. So 'Layer', 'New', 'Shape Layer'. It's actually nothing yet but if I twirl it down, and I can say, "I'd like to add an Ellipse." It's kind of like exactly what we just did by drawing it, but at least directly in the center now.
The other thing we need to add is, this Ellipse has no Fill, no Stroke, I'm going to add our 'Fill'. You can add a Stroke as well, Gradient Fill, Gradient Stroke. I'm just going to have a Fill at the moment. Twirl it down. What color is it going to be? I'm going to pick my light red here. How big is this going to be? Where it says Ellipse Path, open it up. Do Size, this is totally up to you how big you want this to be. You can't move it on the screen yet, we can do that later on. But at the moment, don't move it, needs to be directly in the center. So this is going to be my Base Size. I'm going to rename this Layer. I'm going to call this one 'Desktop'. And that's the bottom part done. What I'm going to do is twirl it up select it, copy, paste it. Right click this one, and this is my next set, which is Mobile.
The first thing we're going to do is change the color. So open up 'Mobile', go to 'Contents', open up 'Fill'. Grab the 'Eyedropper', pick another color. We'll pick this lighter one, actually. Close it back up. And all that's happening at the moment, is there's one over the top. Leave it in the center, we're going to add an Effect. So 'Effects & Presets', type in 'Clock Wipe'. Click, hold, and drag it on to it. And, kind of just disappears. What we can do is, see this Transition Completion? Make sure your Playhead is back at the beginning here. And watch this, if I drag it down, hey left, and right, that is what we're going to be animating. It's pretty easy to do.
The Keyframe's actually started already. So I want to start it at 0 or 100%, so it's completely finished, it's a bit weird, I know. And then after some time-- now, because I have my Playhead somewhere different when I first applied this Effect - you might not have this problem - is if I hit 'U', there's this brand new Keyframe over here. This is just a bye-product, this Effect comes with the Keyframing. Ready to go, so wherever your CTI is, it starts our first Keyframe, so we're going to delete that.
At the beginning here, I've got it set to 100. I've got no other Keyframes. How do I get this up? Remember, with it selected, I can click 'U'. And it will pop up any Keyframes that have been made. After some time, not sure how long a time, I'm going to set the Transition. You can do it up here, go up here. I'm going to work out my-- this is my Mobile one, so this needs to be 14%. Easiest way to do it, is do 100 minus your percentage, which is 14, and click 'Enter'. It gives you the right amount, using this Effect. It's not meant to be used for Pie Charts. We're just kind of using and abusing it. But that is our 14%, so it's going to do that. Nice!
Before I move on to the next Slice, I'm just going to spice this up. We're using that Expression. We've used it loads in this tutorial already. So it is here. It's in my Exercise Files, under Expression. And I'm going to delete all that, just so it gets a little bounce. And then play around with the Timing, to make it look nice. Now it's time for the next Slice. And all I'm going to do is, select 'Mobile', copy and paste it. So I'm using 'Command C' and 'Command V'. If you're on a PC, it's 'Control C', 'Control V'. I'll rename this one, and this is 'Tablet'. And what I want to do is a couple of things. I want to change the color of it, so I'm going to move this along, so I can see it. So go to 'Contents', 'Fill', pick the 'Eyedropper', I'll pick a new color. Now it's right on top of the Mobile, happening at the exact same time.
So the first thing we need to do is change-- we want to kind of pop down here, so you're on the first example. So it's considered the Start Angle. Watch this, if I click, and drag it, I could drag it, and manually line it up, and that would kind of work. I find the easiest way is, go 360 divided by 100 times whatever this one was, which was 14. That's going to give me the exact movement around. I'm terrible with Maths, but somehow those sort of things stick with me. All we want to do now is, it's playing. So this one is at the wrong percentage. So, check Excel, this one's going to be 6%. So what I need to do is, go into Transition Completion. Now I need to make sure my Keyframe is at the end of this animation, so 'Tablet' selected, click 'U'. Have my Playhead just above it. Holding 'Shift' while I'm dragging to snap to the top. Instead of 86, remember our little trick, 100 minus, I can't even remember now. I think it was 6, gives me 94. So that's going to give me my little Slice here. Let's go have a look.
Now the Timing, I'm going to twirl it up. I'm just going to move my Timing so that may be a little bit more. Maybe just a little bit more, so when it stops bouncing, this one comes out nice. So when it's all finished, I'll probably need to add some Labels. But at the moment, that chunk there is what's left over. So 14 plus 6 leaves me my 80%. So that's Desktop, that's Mobile, that's Tablet. What I want to do is, actually, probably this base is a bit boring at the moment. Doesn't do anything, just kind of there. So what I'd like to do is animate that as well. So what I might do is just move these guys along. Back to here. And I'm going to add the exact same thing. So I'm going to grab 'Clock Wipe', add it to 'Desktop'. I'm going to start it at 0. Great. My Playhead was already at the beginning. Remember, click 'U' to see where the Keyframes are. And there's mine out there, it's already applied them all. So I'm going to get rid of you. How far along? So it starts here, and maybe about that far. And I'm going to get it to go all the way around to 0 before this other one starts all the way around.
I'll group it further apart, actually I'm going to add the Easing first. Now, I don't want this one to bounce. Only because I practiced and it looked a bit weird with the Base bouncing back and forth. Kind of opens back up like Pacman. So what I'm going to do is select both of these, and go 'Keyframe Velocity'. I'm using my old trick. And now… Why do I add sound effects? I bet you, you will too. Awesome! So we've got our basic Pie Chart. The cool thing about it is, wherever usable we can use these Slices and just go through and change the percentages, and the Start Angles for every next month, for whatever. You might have 50 of these things, the migration won't take you too long. But we're going to add a little bit of extra dimension.
What I'd like to do is I'd like one of these Slices to pop out. And maybe that's the most important one. We can pop them out at different times, and kind of explain what they are. So I'm going to get this one to pop up. This last Slice for Tablet. And to do it I'm going to get my Playhead down before it stops bouncing, about there. And I'm just going to play with Size. So I'm going to have 'Tablet' selected, click 'S'. I'm going to start the stopwatch for Scale, it slides. It's going to do the same thing. And further along, I'm going to get it to pop out. So it's going to come along, and then that's going to come out.
Now the only trouble is I can't use my Expression in this one. There's just too many things going on. There's two Keyframes, but there's also some Effects going on, and my Expression doesn't work on this one. So we're going to have to do it old school. But luckily we know how to do it old school, right? So I'm going to first add some Easing. Select both of these guys, move your Velocity at '75'. I'm just tabbing across those to make it quicker. So it looks nicer, but I want to go kind of like this bit here, I want to go, say it's going to be 125, that's going to be its finished, kind of like jumping out spot. So what I'd like you to do actually is to go past that little bit, to 130. And then come back, below 125. 122, I'm just guessing here. It might look horrible. And then eventually, rest back at 125. You could put more and more in these to get it to go really slick and smooth. Let's give it a test. It's not bad. Let's zoom in. A bit quite far out. Should have said would've zoomed out this whole tutorial. Not as nice, but you can play around with the timing of these.
The last thing you might do is, we're going to make it like a doughnut shape. And I am embarrassed to show you the method for turning into that doughnut it looked like from the beginning. All we're going to do is grab the 'Desktop', copy and paste it. We're going to call this one the 'Center'. You're going to guess what we're going to do. With the center selected, I'm going to get rid of Radial Wipe because I don't want the Radial wiping in. Now all the center is, it's just a copy of it. I'm just going to change the color of it. And move it to the top. Actually let's stick it to the top now so you can see what I'm doing. It's pretty cheap tricks. Let's go you, pick it back on color. And let's go into 'Ellipse Path', the 'Size'. And how big do you want your doughnut? But it works. Looks like a doughnut, just a little cool pop out thing.
Say you got a colored image background, and say this is not going to work, we will address this a little bit later in the course when we look at Masks. But for the moment, most of the time, especially for this stuff big circle in the center, pops out, looks awesome. What you should do now is go through and just add some Type, obviously the percentages, we'll do a Percentage Counter in the next video so it kind of creeps up at the right dimensions. But you want to add some Labels and stuff to it.
Now, last thing we're going to do before we go is that, to move this thing is a bit weird, and you're like "Oh great, I'm just going to grab all of these guys, and I'm just going to move it over." That Wipe effect, it's actually a Transition effect, so it does it to the whole Scene. You can fix that by Pre-Composing it, it's pretty easy. So I've got all these selected, right click it. Pre-Compose puts it into its own little Comp. And I'll call mine 'Pie Chart'. Actually what did we call the first thing? We don't want another one called Pie Chart. We're going to call this one 'Doughnut'. And back to my Project Files here. So 'Pie Chart 1', and there's this little doughnut that goes inside of it.
Now what happens is, it's just all grouped inside that Comp. Now we can move it around as we need to. And that Wipe effect kind of stays with it. So we can kind of animate it on, slide it on as well, you might go Slide it on, make it look cool.
All right, that's going to be the end of this Pie Chart one. We're going to look at adding some Counting Numbers in the next bit. Also, later in the course, if you're a Pie Charts fan we're going to do something called Masking Stuff with Pie Chart. So check that one out as well. All right, let's move on.