Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on Twitter
LIBRARY:TutorialsVideo TutorialsReviewsInterviewsEditorialsFeaturesBusinessAuthorsRSS FeedTraining DVDs

Line Chart Diagram

COW Library : Adobe After Effects Tutorials : Mylenium : Line Chart Diagram
Line Chart Diagram
A CreativeCOW.net Adobe After Effects Tutorial


Line Chart Diagram

Mylenium
Mylenium
http://www.mylenium.de
Germany

©Creativecow.net. All rights are reserved.

Article Focus:
This tutorial by Mylenium will show you how to create a fully animatable diagram with a few expressions and some thinking around the corner. While there are other techniques to create such graphs manually based upon Masks or the Write-On effect, this one has the advantage of being quite flexible and allowing last minute changes once you have the basic template. It cannot save you from buying dedicated software if you need things such as XML import or more variations of the look, however.

In order to maintain maximum control over the look and avoid overloading one comp with too many layers, we are going to use several pre-compositions and cross-reference them with each other.

Download the Project files here


Step 1: The first comp

First off we need a master composition where we later will put everything together. I named it simply Diagram. This requires nothing special. The only thing you should add to it at this point is a Dummy layer or Null object called Controller and apply some Expression controls to it.

Go to the Effects menu and choose the Slider control from the Expression controls category. Your Effect palette will appear with a effect called Slider control. Select it, hit Return and rename it to Spacing horizontal.

Repeat this step and create sliders for Vertical Lines Thickness, Line Thickness and Point Scale.I suggest that you set the values to something other than 0 to avoid later complications with our expressions (the dreaded "Illegal division by zero"). Now choose the Color control from the Effects menu, apply it three times and rename it Line Color, Point Color and Mask Color respectively.


Step 2: Setting up the points

Next we create a composition called Diagram Points. This one holds the actual values of the diagram in the form of the points' Y position value. For reasons of flexibility I created the actual point shape in yet another sub comp called Point Marker. This way you can easily change the appearance of the points ranging from simple dots to cross hairs to complex blinking symbols.

Make sure all elements are white and have proper alpha if you want to use the Point Color from the Diagram composition's Controller layer.. In order to do so, apply the Tint effect to the layer and link its Map White to property to the respective color control in the Diagram composition. Set the Amount to Tint to 100 %. The placement of the points is in part derived from the Spacing horizontal slider in the Diagram comp using an expression as follows:

[comp("Diagram").layer("Controller").effect("Spacing horizontal")("Slider")*2*(index-1), position[1]]
This expression will calculate the X position from the slider, but use the keyframed Y position.



Notice the differently colored layer with visibility turned off? This layer is actually only needed for our calculations later on but it must be there. You can animate it just the same as the other layers, but just to be on the safe side you should change its position expression to.
[0, position[1]]
You should not forget to connect the point scale to the slider on the Controller layer in the Diagram comp. This will make it easier to balance the point size and line thickness.


Step 3: Get yourself connected

In the next step we create a composition called Diagram Lines in which we will put our lines that connect our points. This is done using a 100x100 pixels solid and some expressions. All that will be required later is to clone the Line layer to match the number of points.

The most important expressions are the position and rotation. To get proper results for those values you need to place the layer's anchor point on its left most edge and at half the height of the layer. For the position use the following expression:

comp("Diagram Points").layer(index).position 
This will place a line at each point. Since the layer does not yet know about its target point it should connect to it will be perfectly horizontal. In order to change this use
diffX=position[0]-comp("Diagram Points").layer(index+1).position[0];
diffY=position[1]-comp("Diagram Points").layer(index+1).position[1];
myRot=radiansToDegrees(Math.atan2(diffY,diffX))-180;
[myRot]
on the rotation parameter. What does this expression do? It takes the layer's position and calculates the difference to the position of the next point (which is the target point). Then those values are used to calculate the arcus tangens which is then converted into an angular value.

You will notice that, depending on your Spacing horizontal value the Line layer will not reach or overshoot the next point. All that is required to fix this, is some simple calculations on the scale parameter.

thickness=comp("Diagram").layer("Controller").effect("Line Thickness")("Slider");
diffX=position[0]-comp("Diagram Points").layer(index+1).position[0]; diffY=position[1]-comp("Diagram Points").layer(index+1).position[1];
a=Math.pow(diffX,2); b=Math.pow(diffY,2); c=Math.sqrt(a+b); [c,thickness]
This is a more complex calculation using Pythagoras' rule (yeah, it was late when I first put my mind on this project ;o) ) but you surely will prefer
thickness=comp("Diagram").layer("Controller").effect("Line Thickness")("Slider");
a=position; b=comp("Diagram Points").layer(index+1).position; c=length(a,b); [c,thickness]
In one go we also connected the Y scale of the solid to act as the line thickness. All that is now left to do is to apply the Tint effect to the layer and connect it to our Controller just as we did with our points.

Basically we now already have a usable diagram if we put our Diagram Points and Diagram Lines compositions in the main Diagram composition. It does not look very exciting, though. So once more unto the breach.


Step 4: Adding fancies

First off we want to have some sort of fill below our curve. How do we do that? Well, we could use a layer with a mask and trace our lines. Isn't that boring? It also limits our flexibility once we decide to change something. So we need a better solution. And here it comes!

Create a new composition named Diagram Mask and add a solid to it. Apply the Corner Pin effect to this layer.



The Corner Pin effect is originally intended to be used in combination with tracking data. This way you could for instance replace footage on a TV screen and match the perspective or apply a different logo to a car.

Instead of using tracking data, we will feed the position values of the four corners with data from our points. The expressions are as follows:

Upper Left:
[comp("Diagram	Points").layer(index).position[0]-2,comp("Diagram	Points").layer(index).position[1]-2]
Upper Right:
[comp("Diagram Points").layer(index+1).position[0]+2,comp("Diagram Points").layer(index+1).position[1]+2]
Lower Left:
[comp("Diagram").layer("Controller").effect("Spacing horizontal")("Slider")*2*(index-2)-1,thisComp.height]
Lower Right:
[comp("Diagram").layer("Controller").effect("Spacing horizontal")("Slider")*2*index+2,thisComp.height]
I added 2 pixels to each value so the layers would overlap once I cloned them. This avoids potential problems with the alpha because the Corner Pin effect will create antialiased edges that do not line up exactly. This is a minor drawback, but wont be noticeable since the unclean areas will be covered by the lines and points. Color the layer to your taste or once more use the Tint effect as I did.

Potential viewers like to have some reference on how they should interpret a diagram, so it's a good idea to add some rulers or grid style elements. Take a look at how I created some of those effects in the supplied project file or create your own look. It's really just a matter of cleverly combining effects or once more cloned layers that are tied to expressions.

You could come up with something like that:



or placed in 3D space something like this:



All that is now left to do is adding numbers and other text where needed and animate everything in a interesting way.

Feel free to ask questions regarding this tutorial in the After Effects forum at Creativecow.net


Please visit our forums at Creativecow.net if you found this page from a direct link.

  Adobe After Effects Tutorials   •   Adobe After Effects Forum
Reply   Like  


Related Articles / Tutorials:
Adobe After Effects
Virtual 3D Sets with After Effects

Virtual 3D Sets with After Effects
  Play Video
Rob Mize demonstrates techniques for creating a virtual set in 3D space. He shows how you can build sophisticated, detailed environments, where your actors appear to interact with their 3 dimensional surroundings. Build the set of your dreams using nothing more than After Effects, a few textures and your creativity.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: The Tilt Shift Effect

Lite Bite for After Effects: The Tilt Shift Effect
  Play Video
In this tutorial, Martin Ainsworth will demonstrate the "Tilt Shift" effect also known as "Toy Town Look" using Abobe After Effect. This simple yet very power technique can add an extra dimension to an opening introduction.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: How do I use 8 or 16 bpc effects on 16 or 32 pbc projects?

Lite Bite for After Effects: How do I use 8 or 16 bpc effects on 16 or 32 pbc projects?
  Play Video
"Lite Bites" are short no-frills tutorials giving quick answers for busy people. In this next AE Lite Bite tutorial, Andrew Devis shows how to use 8 or 16 bpc effects safely on 16 or 32 bpc projects.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: How do I animate Text on a Path?

Lite Bite for After Effects: How do I animate Text on a Path?
  Play Video
"Lite Bites" are short no-frills tutorials giving quick answers for busy people. In this next AE Lite Bite tutorial, Andrew Devis shows how to quickly and easily animate text on a path.

Tutorial, Video Tutorial
Adobe After Effects
You Ask....I Answer: Masking vs Track Matting Part 2: Adobe After Effects

You Ask....I Answer: Masking vs Track Matting Part 2: Adobe After Effects
  Play Video
In this tutorial, Kevin P McAuliffe takes a look at doing the same viewer requested track matting technique he showed in Motion 5, but the time he demonstrates the technique inside of Adobe After Effects.

Tutorial, Video Tutorial
Adobe After Effects
Lite Bite for After Effects: How do I create a simple Light Wrap?

Lite Bite for After Effects: How do I create a simple Light Wrap?
  Play Video
"Lite Bites" are short no-frills tutorials giving quick answers for busy people. In this first AE Lite Bite tutorial, Andrew Devis shows how to make a quick 'light wrap' effect for a keyed item so that the edge or alpha channel of the keyed item includes some of the pixels from the background element so that it starts to look as if the two items really belong together.

Tutorial, Video Tutorial
Adobe After Effects
Weißabgleich nachträglich ändern ein Quicktip in Adobe After Effects

Weißabgleich nachträglich ändern ein Quicktip in Adobe After Effects
  Play Video
Weißabgleich nachträglich ändern ein Quicktip in Adobe After Effects von Lucas Pfaff: lernen die Grundlagen der Weißabgleich.

Tutorial, Video Tutorial
Adobe After Effects
Using the Scribble & Stroke Effects

Using the Scribble & Stroke Effects
  Play Video
The "Scribble" and the "Stroke" effects are often overlooked due to the fact that it isn't immediately obvious how they work as they won't work unless applied in a very particular way. In this in-depth tutorial, Andrew Devis explains how to apply these effects and then goes through the many options in each effect which can make them very powerful and able to produce a surprisingly large variety of results.

Tutorial, Video Tutorial
Adobe After Effects
Character Design and Animation in AE: Part One

Character Design and Animation in AE: Part One
  Play Video
Rob Mize demonstrates the process of designing, creating and animating a character entirely in After Effects. Part 1 focuses on the design and creation of the character using nothing more than AE shapes.

Tutorial, Video Tutorial
Adobe After Effects
Adobe Creative Cloud Offers Applications, Services, Community

Adobe Creative Cloud Offers Applications, Services, Community

With Creative Cloud, Adobe is switching from a model of software as a product to Software as a Service (SaS). By early 2012, Adobe Creative Cloud is expected to include such applications as After Effects, Premiere and Photoshop. Creative Cloud includes a hub for viewing, sharing and syncing of files, and a subscription with 20GB of cloud storage.

Feature, People / Interview
MORE


FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2012 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]