Support

  Project Based Tutorials - Charts

Charts:
Animated Pie Charts
Download:
PDF / Project
Works with:
GO, SE, XL
Requires:
Version 5.1+
 


 
Description:

Making an animated pie chart is incredibly easy with Cinema 4D. Cinema 4D's ability to interpret mathematical functions allows you to calculate your percentages into angles quickly and efficiently.

First you will need the numbers for the chart you are going to create. Of course, they must add up to 100%. For the purposes of this tutorial you can use the random figures of 37%, 5%, 14%, 20% and 24%.


 
Step 1. To create segments representing each percentage of the pie, from the menu go to Objects: Splines: Circle Elements: Segment.

Let's start with a fairly large wedge, like the one for 37%. Simply enter the following formula in the angle perameter (360*0.n) where n is enter the percentage you want to represent, in this case 37. This will generate a segment representing exactly 37% of our 360 degree pie chart.


 
Step 2. You will notice that your segment comes out standing on it's side. If you want it to lay down you need to rotate it 90 degrees on the x axis.

Create the rest of your slices in the same manner.


 
Step 3. Once you get more than one segment you will notice that they all seem to stack on top of each other. This is easy to fix.

Simply enter in the formula you used to create this spline in the coordinates manager under direction in the B parameter.

For the second wedge, you would enter (360*.05). This will rotate the segment exactly 18 degrees or 5%.


 
To place subsequent segments, you need to add the rotations of all the segments preceding it. For the second one you would enter (18+360*.14) and so forth and so on.

 
Step 4. Once you have finished generating and arranging your segments, check to make sure they form a complete circle (unless the total of your percentages does not equal 100%).

 

 
Step 5. To make your actual pie wedges you need to extrude these segments. First, make sure you have one of your segments selected, then go to Objects: Spline Objects: Extrude Object.

Extrude your spline along the Z axis. You can use any height, but for this tutorial use a height of 100m. Now go to the caps page of your extrude oject dialogue and make sure you have caps turned on. Whether or not you have rounding turned on is up to you. In this tutorial we left the rounding off.

If you group all of your segments together you can extrude them all at the same time. If you you want to have the segments tiered you will have to extrude them one at a time and adjust the settings accordingly.

Step 6. Once all your slices have been generated, you can texture them as you see fit. For the purposes of a pie chart, we generally go with solid colors with the default highlight and about 25% reflection.

This creates a chart that is easy to follow, yet still looks interesting if you animate it.

Step 7. Now you can animate your pie chart in many ways:
- Fly the wedges in one-by-one from the top or sides.
- Use a scaling track to have the wedges rise up out of a floor.
- Use a texture track to highlight different parts during an animation. (SE and XL only)

Option:
Making Wedges Interactively Fan Out (SE and XL only)

1. Move the axis of all the wedges to the center of the pie chart.
2. You are going to rotate each wedge out of the wedge previously revealed, so you will need to scale each wedge slightly smaller than the previous wedge.
3. It is best to start with the largest wedge (37%) already visible. Then animate the wedges in order from largest to smallest as each will be revealed from the previous.
4. Add a Visibility track (with no sequence) so each wedge appears just before it fans out.
5. At the keyframe where the wedge appears, add a Direction track where the wedge will start fanning out. You will only be affecting the B coordinate. If you are using our percentages, the first wedge you will animate would be 24% (then 20%, 14% and 5%). For the 24% wedge, the value for the first keyframe is equal to the final B coordinate of the wedge before it. In this case 0.
6. Now add a keyframe at the end of your direction sequence with the wedge's final rotation in the B coordinate. In this case that would be (0+360*.24).
7. Now do the same with each wedge that follows. Note the first number in the last frame is equal to the calculation in the first frame.
- 20% First Frame=(360*.24) / Last Frame=(86.4+360*.20)
- 14% First Frame=(86.4+360*.20) / Last Frame=(89.28+360*.14)
-5% First Frame=(89.28+360*.14) / Last Frame=(62.8992+360*.05)


 

 
Option: Reverse Assembling Your Wedges (SE and XL only)

1. Subdivide your wedges. A setting of 1 is fine unless you want smaller explosion bits.
2. Create an explosion track for each piece.
3. Use the Time Control, "Ramp Down" (above) to make each explosion track run backwards. Ramp Down is available under Curves: Ramp Down.

The explosion track will now run in reverse making your pieces assemble from nothing.



© 2009 All rights reserved. For the personal and/or professional use of Cinema 4D users only. Reprint without permission is strictly prohibited.

© 2010 All rights reserved
Copyright Information |
Privacy Policy | Terms of Use