-
Pie Chart Successive Rotation
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 - angle2n=thisComp.layer("Sliders").effect("SC1P")("Slider");
linear(n,0,100,0,-360); //this is rotation of the Nulln=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 radiusv=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