Skip to main content

Guide · with a free chart maker

How to animate a graph in After Effects

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.

Or animate it here

It opens with sample data playing. Swap in yours whenever you like.

CSV, Excel or JSON · or drop a file here · nothing is uploaded

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).

Animate a line graph with Trim Paths

  1. Draw the line

    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.

  2. Add Trim Paths

    Twirl open the shape layer, click Add next to Contents and choose Trim Paths.

  3. Keyframe the end

    Set End to 0 % at the start, then to 100 % a few seconds later. The line now draws itself.

  4. Ease it

    Select the keyframes and apply Easy Ease (F9), then shape the curve in the Graph Editor for a gentle finish.

  5. Add a riding label

    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.

Animating bars and pies

Bars

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.

Pies and donuts

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.

Driving the chart from data

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.

A faster route for common charts

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.

After Effects graph animation questions

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 %.

Why does my bar grow from the middle?

Its anchor point is in the centre. Move the anchor point to the bottom edge, then animate Scale.

Can After Effects read a CSV file?

Yes. Import it as footage and link properties to its values with expressions; MGJSON files can be converted to keyframes.

Can I import a chart from chart.video into After Effects?

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.