FORUMS: list search recent posts

Pie Chart Successive Rotation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kristian Tonnessen
Pie Chart Successive Rotation
on Dec 22, 2010 at 1:10:02 am

As a tutorial, I created a pie chart from someone else's post here. Using Radial Wipe, 5 solids and 5 slider controls. Works fine. I then wanted the percentage numbers to follow the reveal of the pie along the radius of the circle. I created a Null and attached text (number) to it. The source text is driven by the sliders. I offset the text to the top of the circle and used the 'linear' expression below. The rotation of the Null is driven by the slider. The position of the text follows the Null rotation (which happens to be counter clockwise) but the text rotates in the opposite direction to stay upright. This works fine. The problem I cannot solve is getting the 4 remainder Nulls with attached texts start at the last rotation of the previous slider and have the reverse rotation of the text be able to match up with the corresponding slider AND/OR the previous slider. Hope this makes sense!

L = thisComp.layer(index - 1); // this is the radial wipe that starts at the previous completion %
angle1 = L.effect("Radial Wipe")("Start Angle");
angle2 = (100 - L.effect("Radial Wipe")("Transition Completion"))*3.6;
angle1 - angle2

n=thisComp.layer("Sliders").effect("SC1P")("Slider");
linear(n,0,100,0,-360); //this is rotation of the Null

n=thisComp.layer("Sliders").effect("SC2B")("Slider");
linear(n,0,100,0,360); // this is the text layer that is attached to the Null with position offset to radius

v=thisComp.layer("Sliders").effect("SC2B")("Slider")
check = v % 1
if (check == 0){"" + v + "%"}else{v} // this is on the text layer and adds the % after the numbers





Return to posts index

Chris Wright
Re: Pie Chart Successive Rotation
on Dec 28, 2010 at 9:46:02 pm

if you upload a project, ill take a look, it's just too messy for me to create from scratch. I'm guessing since you're multiplying angles, you're definitely going to have issues. also, the sizes would have to be the same. sin and cos are more reliable than a wipe effect.

http://technicolorsoftware.hostzi.com/


Return to posts index

Kristian Tonnessen
Re: Pie Chart Successive Rotation
on Dec 29, 2010 at 1:51:45 am

Ok thanks. I figured out one possible solution by adding each successive rotation position, but it isn't very accurate (shifting occurs). Here's the original project with the problem occurring on Null 2, and the second txt layer, '0 2.'

Truly appreciate the insight!

// I was able to upload the AE project, but I'm apparently still in moderation so there may be a delay actually seeing it.

Kristian Tonnessen
Graphic • Motion Designer
KING 5 Television • Seattle, WA


Return to posts index


Kristian Tonnessen
Re: Pie Chart Successive Rotation
on Dec 29, 2010 at 2:46:40 am

Pie chart CS3 AE project here:

https://files.me.com/beloseattle/lcdhzc

Kristian Tonnessen
Graphic • Motion Designer
KING 5 Television • Seattle, WA


Return to posts index

Chris Wright
Re: Pie Chart Successive Rotation
on Dec 29, 2010 at 8:13:05 am

it was..gah.. messed up everywhere. I didn't finish it, I just did the blue and purple. They both talk to each other with both size and angle so that the text always remains in the center of the pie sectors. Also, I didn't code the error detection for oversized pie pieces.


1443_piechartworkup2.aep.zip


t2 text example:

rot = thisComp.layer("Null 1").transform.rotation;
rot2 = thisComp.layer("Null 2").transform.rotation;



mu = degreesToRadians((rot/2)+(rot2/2));//add cumulative pies
r = 540;
value+[Math.sin(mu)*r, -Math.cos(mu)*r]

A Custom pie chart Effect too
http://aenhancers.com/viewtopic.php?f=4&t=1533


http://technicolorsoftware.hostzi.com/


Return to posts index

Kristian Tonnessen
Re: Pie Chart Successive Rotation
on Dec 29, 2010 at 8:49:10 pm

LOL. Yes it was messy, but I was trying to solve the problem which is really part of the expression journey right? I truly appreciate your time and sharing of information. I see how it works, I just need to dust of the trig books and brush up. Thanks Chris!

Kristian Tonnessen
Graphic • Motion Designer
KING 5 Television • Seattle, WA


Return to posts index


Matt Howarth
Re: Pie Chart Successive Rotation
on Aug 26, 2017 at 10:37:19 am

thanks Chris

I'll take a look

cheers

Matt

Visual tinkerer and easily distracted admirer of all things shiny! - writer - animator - digital artist


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]