Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
LIBRARY:TutorialsVideo TutorialsReviewsInterviewsEditorialsFeaturesBusinessAuthorsRSS Feed

Line Chart Diagram

COW Library : Adobe After Effects Tutorials : Mylenium : Line Chart Diagram
Share on Facebook
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  
Share on Facebook


Related Articles / Tutorials:
Adobe After Effects
mocha Tracks The Wolf of Wall Street

mocha Tracks The Wolf of Wall Street

Oscar-winning VFX Supervisor Rob Legato and Brainstorm Digital use mocha visual effects tools on Martin Scorsese's Wolf of Wall Street.

Editorial, Feature
Adobe After Effects
Klip Collective Pushes Film Into New Spaces At Sundance

Klip Collective Pushes Film Into New Spaces At Sundance

Projection mapping installation relies on Adobe Creative Cloud tools to create stunning visuals for the Sundance Film Festival entry, "What's He Building in There."

Editorial, Feature, People / Interview
Adobe After Effects
Joseph Kosinski’s Film “Oblivion” Showcases Elegant Effects

Joseph Kosinski’s Film “Oblivion” Showcases Elegant Effects

World‐class user interface designers, graphic artists, and animators create crisp, timeless visual elements for the sci-fi film starring Tom Cruise and Morgan Freeman, Oblivion. Kosinski turned to Bradley G. Munkowitz (GMUNK), whom he'd previously worked with on Tron Legacy. As lead interface graphic designer, GMUNK then pulled a team together that included Interface Graphic Designers Joseph Chan (Chanimal) and Jake Sargeant, and Interface Animators Alexander Perry (AP), Navarro Parker (Nav), and David Lewandowski (D-Lew). They were happy to reunite to share how much fun they had creating the 2D effects for the film using an Adobe workflow.

Editorial, Feature, People / Interview
Adobe After Effects
Star Trek Into Darkness: Main Titles, Graphics & Displays

Star Trek Into Darkness: Main Titles, Graphics & Displays

Andrew Kramer of Bad Robot and author/owner of the site Video Copilot was tapped to create more than 30 title sequences for the resurrection of the classic science fiction franchise with Star Trek: Into Darkness, while the OOOii team created stunning graphics and heads-up displays for the blockbuster film. OOOii CEO Kent Demaine, Lead Designer Jorge Almeida and Andrew Kramer shared their great experiences working on the latest seminal Star Trek film.

Editorial, Feature, People / Interview
Adobe After Effects
Delivering Content for TV's Top Shows

Delivering Content for TV's Top Shows

Delivering content for some of television's top shows, including House of Lies, Grey's Anatomy, and, of course The Walking Dead, Stargate Studios continues to break the mold of how feature films, television series, electronic games, and commercials are generated. In this article, read how Adobe Creative Cloud and automation create a competitive edge for the iconic production studio, Stargate Studios.

Editorial, Feature, People / Interview
Adobe After Effects
Adobe Ups Creative Cloud and Adobe Anywhere

Adobe Ups Creative Cloud and Adobe Anywhere

Adobe has updated its Creative Cloud with 150 new features, including numerous video tools for Premiere Pro, After Effects, SpeedGrade and other components. In addition, the company has also planned significant updates to Adobe Anywhere Video, the "modern collaborative workflow platform" that allows Adobe pro-video solutions benefit from centralized media and assets across standard networks.

Editorial, Feature, People / Interview
Adobe After Effects
Fans OCCUPY Conan With Self-Produced Parodies

Fans OCCUPY Conan With Self-Produced Parodies

Lead editor Dan Dome and editors Robert Ashe, Jr., Chris Heller and David Grecu all put together OCCUPY Conan, a fan-sourced episode of the popular late night show. It's harder than it sounds, and that's why the Conan Editing Team is now up for an Emmy for Outstanding Multicam Editing for a Comedy Series.

Editorial, Feature, People / Interview
Adobe After Effects
Advanced AECC Techniques: Hollywood VFX - Michael Bay Look

Advanced AECC Techniques: Hollywood VFX - Michael Bay Look
  Play Video
In this lesson, Kevin P McAuliffe breaks down how to create the cool lens filter effect that Michael Bay uses in almost all of his movies. Although in most cases this effect is created "in-camera", there are reasons you would want to do the effect in post. Once you see how to create this effect, it will become a "go-to" effect you can keep in your back pocket for those clients whose footage needs that extra boost!

Tutorial, Video Tutorial
Adobe After Effects
Advanced AECC Techniques: Hollywood Visual Effects - AvP ONE

Advanced AECC Techniques: Hollywood Visual Effects - AvP ONE
  Play Video
In this lesson, Kevin P McAuliffe creates a Hollywood-style effect to simulate the end tag of a big budget trailer. The techniques in this lesson can be transferred over to creating bumpers and endtags for television, as well as elements for DVD and Blu-ray releases.

Tutorial, Video Tutorial
Adobe After Effects
Advanced AECC Techniques: Hollywood Visual Effects - AvP TWO

Advanced AECC Techniques: Hollywood Visual Effects - AvP TWO
  Play Video
In this lesson, Kevin P McAuliffe builds on lesson one by not only showing you how to break down a title treatment and animate it on the screen, but also how to use the Adobe Bridge to your advantage to take animations that might take you minutes or hours to create, and be able to drop them on in seconds.

Tutorial, Video Tutorial
MORE


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

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

[Top]