How I animated $40 trillion of US debt

This milestone has received a lot of coverage recently, so I wanted to create an exploding animated line chart to tell this story. What I'm going to do here is give you a full tutorial on how I did it and the techniques that I used to create what you see below.

If you follow this tutorial, you can build a chart just like this. You don't necessarily need to use the same dataset or follow the same story. You can use your own data to create a unique data story for your audience.

First some context

The US has the largest and most liquid government bond market in the world, underpinned by the privilege of issuing the US dollar. The dollar is considered a global reserve currency with very few substitutes. As a result, the United States can borrow on a scale no other country can, which is how its debt has reached $40 trillion, with the possibility of borrowing even more.

Now this is a very complex macroeconomic issue, and I'm not going to go into a deep discussion about it because that is not what this tutorial is for. The goal here is to spark a debate and sit back and listen.

How I built it

What I did first was take 236 years of US government debt history.

The goal was to compress a huge amount of data and tell the story it revealed in the space of just two minutes, reducing the attention span needed to take it all in.

The benefit of this approach is that it allows the user to interact and interpret the story themselves. I wanted to hear macroeconomic perspectives I've never heard before, so I can learn from the dataset.

How I actually did this in Eeagli

You can do everything in this tutorial inside the Eeagli platform, and it's really simple! Just follow these steps.

  1. Log in to the platform.

  2. Create a new line chart with your custom brand.

    Start a line chart with your brand already applied.

Start with clean data and the story behind every spike

The data comes from two places: the US Treasury's historical debt records and FRED, the St Louis Fed's database.1 I merged them into one clean file running from 1790 to today using Codex, then cross-checked it against both sources.

Starting in 1790 was deliberate. That's as far back as the US Treasury's records go. The department was founded in 1789, and its first figure for the national debt dates from 1 January 1790, almost all of it the bill for the Revolutionary War. FRED's quarterly series only starts in 1966, which is why so many debt charts begin there. I joined the two. The Treasury's annual figures carry the line from 1790 to 1965, FRED's quarterly figures take over from 1966, and between the annual points the line runs straight from one year to the next.2

Before designing anything, I researched what caused every big move in the line. That research decided which events made it onto the chart. The goal was to understand every spike in debt throughout US history before a single frame of the chart was made.

  1. Upload the data you cleaned.

    Drop in your cleaned file and the line draws itself.

Annotate the causes, not the calendar

I marked only the moments that moved the line: the Revolution, the War of 1812, Andrew Jackson, the Civil War, the First World War, the Great Depression, the Second World War and Korea, the Cold War, the financial crisis and the pandemic. Each gets a date range and a sentence or two.

The dots are pinned to the line with Eeagli's trace tool, so they ride along as the chart animates. The text doesn't move. I placed it straight onto the canvas, because a paragraph sliding around with the line is hard to read and looks messy. Each note fades in as the line reaches its event and fades out when the next one arrives.

One annotation is more interesting for what didn't happen. The chart groups the Second World War with Korea, but Korea barely moved the line. Debt rose by less than 4% between early 1950 and mid-1953, because the war was paid for mostly with tax rises rather than borrowing.

Annotate an event only if it changes how the reader reads the line.

  1. Go into edit mode and place the event dots on the line using the track line mode.

    A tracked dot rides along the line as it animates.
  2. Select each dot and use the animation dropdown to fade them in at the right time.

    Time each dot to appear as the line reaches its event.
  3. Add your text to the canvas. You can either track the dot or have them static on the canvas like I have in this example.

    Track the dot, or keep the text still, as here.
  4. Fade them in with the dots at the same time, then decide when to fade both the dot and the text out at the same time.

    Bring the note and its dot in together, and take them out together.

A running total for drama

Now, this is something I don't often do with a data visualisation, but sometimes it can make it so much more powerful if you do. What I did was create an animated ticker of US debt at the bottom of the chart, just to add more drama to the data visualisation.

There were a couple of challenges that I had.

First, the data I had was in billions, so I had to create a new column in the data editor that expressed the total amount of debt in the United States. That meant that I had to multiply the data I had in billions by a billion to get the real number. Then I deactivated the series that I created when I made a new column of data, so it wouldn't plot a new line. It's very important that you do this if you decide to do what I did.

Then I created a fresh new text box in edit mode using the canvas tool ribbon. I linked it to that column so that it would create a ticker. You can do this in the control panel by setting the settings to follow a data series, as you can see below.

A hidden series in full dollars drives the ticker.

Pictures make the words easier to read

The next step I took was to add an image to every annotation that I made on the line. There is a practical reason for doing this. A picture gives you the gist of an era at a glance, and that makes the text easier to read, because you already know what it's about.

When a chart is moving, people don't always have time to read every word, or they look away for a second. The picture tells them enough, and gives them a reason to scrub back for what they missed. The images fade in and out with their text, so they never outstay the moment. They're illustrations, not archive photographs, and they're labelled as such.

An image that makes the words easier to read earns its place. One that only decorates doesn't.

If you want to do the same, it's super simple.

  1. Go into edit mode and select picture, and then either select the image you want from your computer or from your media library.

    Add an image from your computer or your media library.
  2. Just like a text box or a dot, you can track another object on the canvas or fade the picture in and out as the animation plays.

    Pictures fade in and out like any other object.

Where you get your pictures from is entirely up to you. In this instance, I used Google's Gemini image models to create my historic event images.3 But you can easily use a stock image library or create your own images.

Animated charts don't need a log scale

This is the decision people ask me about most, and the one I've grown tired of explaining.

If you're making a static chart of data like this, you should use a log scale. On a linear axis, 236 years of compounding debt becomes a hockey stick and everything before about 1980 is crushed flat against the bottom. A log scale straightens out that exponential growth so you can see the spikes across the whole history.

An animated chart doesn't have that problem. The line reveals itself one period at a time, and the axis grows with it. In the 1790s the scale tops out at around $80 million. By the Civil War it's counting in billions, by 1946 in hundreds of billions and by 2026 in tens of trillions. You see every spike at the moment it happens, at the scale it happened at. You experience the exponential growth instead of having to decode it using a log scale.

Too many people apply static rules to animated charts. They're different media with different problems. The one condition is that the axis has to grow with the line.

A log scale solves a static chart's problem. Animation solves the same problem a different way.

Switch to log when the chart stops moving

At the end the chart holds still for about ten seconds. Feedback from my followers is consistent: they want time to take in the finished chart, so I always leave a pause of at least ten seconds. This is very easy to do in the control panel on the left.

Hold the finished chart for at least ten seconds.

The challenge I had now was that I paused an animated chart, which created a static chart. So the linear y-axis that I had was no longer suitable because all the prior years of history became compressed.

The solution is to animate the y-axis and convert it from a linear scale to a log scale in one swift action. This is a new feature in Eeagli, and it is as simple as going into edit mode, selecting the y-axis and then pressing on the drop-down to animate the y-axis from linear to log, which I've done here.

One setting animates the axis from linear to log.

Then I added dots and labels to mark the key events on the now rescaled log version of the chart, which I faded in at the start of the pause.

Mark the big moments once the history is visible.

Music that sets the tone

I like to add music to my animated charts because I feel that it makes the charts more dramatic and cinematic. I took this particular track from Epidemic Sound and cut it to the two-minute length of the animation.

I prefer to pay for music rather than use free tracks because I like to reward the artist who created the music in the first place.

I didn't sync the music to the data this time. I've done it before, but with this many peaks I'd have had to remix the track heavily, and it wouldn't have added enough. The mood carries it.

Sync the music to the data when there's one big moment. When there are a dozen, set the tone instead.

Build it yourself

This took me about an hour to make, but typically you can create an animated line chart in less than 15 minutes. This is probably one of the more complex examples I've worked on.

So why don't you try it yourself? Sign up and build an animated line chart, whether it is for LinkedIn, TikTok, Instagram or for your PowerPoint presentation. It's really not that difficult to do.

Sign up and build it

Footnotes

  1. Sources: US Treasury historical debt outstanding (annual, 1790 to 1965) and FRED series GFDEBTN, Federal Debt: Total Public Debt (quarterly, from 1966). The final data point is the Treasury's Debt to the Penny figure for 8 October 2026, rounded to the nearest $100 million. Figures are nominal US dollars, not adjusted for inflation or the size of the economy. Data to 8 October 2026. ↩
  2. Before 1966 the Treasury publishes one figure a year, so the quarters between those figures are straight-line estimates. They show the trend, not actual quarterly readings. ↩
  3. Annotation images are illustrations generated with Google's Gemini image models. They are not archive photographs. ↩