How do I make a line draw itself in After Effects?
Add Trim Paths to the shape layer and keyframe End from 0 % to 100 %.
Guide · with a free chart maker
The three classic techniques (Trim Paths for lines, Scale for bars, a stroked ellipse for pies) and how to drive them from a spreadsheet with data-driven animation.
In After Effects, a line graph is usually a shape layer path animated with Trim Paths (keyframe End from 0 % to 100 %), a bar is a rectangle whose anchor point sits on the baseline so its Scale grows it upward, and a pie is a thick stroke on an ellipse, also revealed with Trim Paths. Data-driven animation can link these properties to a CSV or JSON file.
After Effects gives total control at the cost of time: a polished race or a line chart with moving labels can take hours to build. If you need the chart rather than the craft, the tool at the top of this page animates a line chart from pasted data in seconds, and can export a transparent WebM, which tools such as OBS Studio and FFmpeg-based editors keep as an overlay (After Effects itself doesn’t read WebM transparency reliably).
With the Pen tool and no layer selected, click the points of your line to create a shape layer with a stroke and no fill.
Twirl open the shape layer, click Add next to Contents and choose Trim Paths.
Set End to 0 % at the start, then to 100 % a few seconds later. The line now draws itself.
Select the keyframes and apply Easy Ease (F9), then shape the curve in the Graph Editor for a gentle finish.
Parent a text layer to a null that follows the line’s end, or use an expression to place it at the path’s end point.
Draw a rectangle, move its anchor point to the bottom edge with the Pan Behind (Anchor Point) tool, then keyframe Scale with the width unlinked: height from 0 % to its value. Offset each bar’s keyframes by a few frames for a one-by-one build.
Draw an ellipse with no fill and a stroke as wide as the slice’s thickness, add Trim Paths and keyframe End. Duplicate the layer for each slice and set Offset so each slice starts where the previous one ends.
After Effects can import JSON, MGJSON, CSV and TSV files as footage and link layer properties to their values with expressions (pick-whip the property to the data). For MGJSON files, right-clicking the data layer offers Keyframe Assistant → Create Keyframes from Data. This keeps a chart in step with a spreadsheet, but building ranking logic for a race in expressions is a project in itself.
Data-driven Motion Graphics templates go a step further: you build the chart once in After Effects and an editor drops a CSV onto it in Premiere Pro. They hold text, colour and number values rather than data over time.
For a line race, bar chart race, pie, counter or bubble race, paste your table into the tool above and export. Transparent WebM keeps the alpha in OBS Studio and FFmpeg-based editors; for After Effects or Premiere Pro, export an MP4 with a background that matches your scene, or a PNG still.
Add Trim Paths to the shape layer and keyframe End from 0 % to 100 %.
Its anchor point is in the centre. Move the anchor point to the bottom edge, then animate Scale.
Yes. Import it as footage and link properties to its values with expressions; MGJSON files can be converted to keyframes.
Yes, as an MP4 (with a background) or a PNG still. After Effects doesn’t read WebM transparency reliably, so use the transparent WebM in OBS or FFmpeg-based editors instead.